ethumb - fix index range check

fix CID 1402628
This commit is contained in:
Carsten Haitzler 2020-09-19 23:13:08 +01:00
parent fd93bed3d1
commit d64d4568bd
1 changed files with 2 additions and 0 deletions

View File

@ -252,6 +252,8 @@ _ec_op_generate(struct _Ethumbd_Child *ec)
r = _ec_read_safe(stdin, &idx, sizeof(idx));
if (!r)
return 0;
if ((idx < 0) || (idx >= NETHUMBS))
return 0;
r = _ec_pipe_str_read(ec, &path);
if (!r)