Skip to content

Commit

Permalink
Fix: Test if location is null in cve_scan_host to prevent an assertio…
Browse files Browse the repository at this point in the history
…n error

Merge pull request #1711 from greenbone/mergify/bp/main/pr-1709
Added a test if location is null to prevent an assertion error. (backport #1709)
  • Loading branch information
timopollmeier authored Oct 26, 2021
2 parents 44a054a + ff3874c commit d979e45
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d979e45

Please sign in to comment.