ethumb - check inoput index from stdin
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>
Sat, 19 Sep 2020 22:03:20 +0000 (23:03 +0100)
committerJongmin Lee <jm105.lee@samsung.com>
Sun, 20 Sep 2020 21:15:36 +0000 (06:15 +0900)
fix CID 1402646

src/bin/ethumb_client/ethumbd_slave.c

index d7b7ff6680fd0f9a41d73f06d6c83bc02f7e24df..984cc9bafabb84ab4bebc8b1a9fd204bba82d2d2 100644 (file)
@@ -667,6 +667,8 @@ _ec_op_setup(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_read_safe(stdin, &type, sizeof(type));
    if (!r)