Skip to content

Commit

Permalink
Fix: segmentation fault and false positive on empty function body (#1102
Browse files Browse the repository at this point in the history
)
  • Loading branch information
nichtsfrei authored May 24, 2022
1 parent 6e3a09f commit 776a0cd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions nasl/lint.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,9 @@ static void
check_called_files (gpointer key, gpointer value, GSList **unusedfiles)
{
if (key != NULL)
if (g_strcmp0 (value, "YES") != 0)
// only check for includes not for main file
if (nasl_get_include_order ((const char *) key) > 0
&& g_strcmp0 (value, "YES") != 0)
*unusedfiles = g_slist_prepend (*unusedfiles, key);
}

Expand Down Expand Up @@ -433,7 +435,7 @@ is_deffunc_used (const char *funcname, const char *filename,
return 1;
current = current->next;
}
while (current->next != NULL);
while (current != NULL && current->next != NULL);
return 0;
}

Expand Down

0 comments on commit 776a0cd

Please sign in to comment.