aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/ethumb_client
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-12-13 20:46:10 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-12-13 21:26:05 +0900
commit83615efe6ae1878fd368e352d3ca85dca01b58e0 (patch)
treeba2dee84aac5eaf05d9f20cf8eefa6ca88b5466b /src/bin/ethumb_client
parentedje - epp - fix possible array access by negative (diff)
downloadefl-83615efe6ae1878fd368e352d3ca85dca01b58e0.tar.gz
ethumbd - fix possible out of bounds access to work table
this should fix CID 1039314 in case an unsused table slot cannot be found. this should actualyl never happen because table expands/allocs zero out new entires so they are "unused".
Diffstat (limited to 'src/bin/ethumb_client')
-rw-r--r--src/bin/ethumb_client/ethumbd.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/bin/ethumb_client/ethumbd.c b/src/bin/ethumb_client/ethumbd.c
index a0313c57e8..5d583688b7 100644
--- a/src/bin/ethumb_client/ethumbd.c
+++ b/src/bin/ethumb_client/ethumbd.c
@@ -811,6 +811,12 @@ _ethumb_table_append(Ethumbd *ed)
break;
}
+ if (i >= q->max_count)
+ {
+ CRIT("cannot find free table slot in table of %i", q->max_count);
+ return -1;
+ }
+
snprintf(buf, sizeof(buf), "%s/%d", _ethumb_dbus_path, i);
q->table[i].used = 1;
q->table[i].path = eina_stringshare_add(buf);