From ff3874ce07180edd86d64f05c187fc4c45763d68 Mon Sep 17 00:00:00 2001 From: Johannes Helmold Date: Tue, 26 Oct 2021 08:48:39 +0200 Subject: [PATCH] Added a test if location is null to prevent an assertion error. Added a test if the char* location is null after the assignment "location = app_locations_iterator_location (&locations_iter);" to prevent an assertion error. (cherry picked from commit 8890ee7c7c05743b46defdc9bb79429f4cdcb95d) --- src/manage.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/manage.c b/src/manage.c index cc040bd73..5ac7a0dc8 100644 --- a/src/manage.c +++ b/src/manage.c @@ -2892,6 +2892,13 @@ cve_scan_host (task_t task, report_t report, gvm_host_t *gvm_host) const char *location; location = app_locations_iterator_location (&locations_iter); + if (location == NULL) + { + g_warning ("%s: Location is null for ip %s, app %s", + __func__, ip, app); + continue; + } + if (locations->len) g_string_append (locations, ", "); g_string_append (locations, location);