summaryrefslogtreecommitdiff
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
parentabb780bf5f8730cc03b0fcf62d0a10e5ae50aa6a (diff)
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".
-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 a0313c57e..5d583688b 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);