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".
This commit is contained in:
Carsten Haitzler 2013-12-13 20:46:10 +09:00
parent abb780bf5f
commit 83615efe6a
1 changed files with 6 additions and 0 deletions

View File

@ -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);