From 033e292301fa569738b20768b8d1f1d7d0bc1ca7 Mon Sep 17 00:00:00 2001 From: ritt Date: Tue, 11 Feb 2020 11:15:35 +0100 Subject: [PATCH] Fixed NULL pointer deference in show_uploader_json --- src/elogd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/elogd.c b/src/elogd.c index ace63507..2faf492a 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -27088,6 +27088,8 @@ void show_uploader_json(LOGBOOK *lbs) { for (i = 0; i < attch_count; i++) { sprintf(attchname, "attachment%d", i); + if (!isparam(attchname)) + continue; rsprintf(" {\r\n"); rsprintf(" \"fullName\": \"%s\",\r\n", getparam(attchname)); @@ -27108,7 +27110,6 @@ void show_uploader_json(LOGBOOK *lbs) { rsprintf(" \"contentType\": "); - for (j = 0; filetype[j].ext[0]; j++) if (chkext(filename, filetype[j].ext)) break;