From 7d5f64430b68414ff61ea8c8c09fa890f035320e Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Sun, 19 Apr 2020 00:44:48 +0100 Subject: [PATCH] shot upload - handle invalid args even though they never will be since the caller is e's shot module, they will be sane, but coverity in theory is right. fix CID 1425221 --- src/modules/shot/upload.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/modules/shot/upload.c b/src/modules/shot/upload.c index b7236a30c..e4f9f8151 100644 --- a/src/modules/shot/upload.c +++ b/src/modules/shot/upload.c @@ -99,6 +99,10 @@ elm_main(int argc, char **argv) stride = atoi(argv[4]); // stride per line in bytes quality = atoi(argv[5]); // qwuality to save out as (100 == lossless png) if (argc >= 7) out_file = eina_stringshare_add(argv[6]); // out file path + if ((w <= 0) || (w > 65535) || (h <= 0) || (h > 65535) || + (stride <= 0) || (stride > (65535 * 4)) || + (quality < 0) || (w > 100)) + return 1; // set up buffer window as scratch space elm_config_preferred_engine_set("buffer");