Skip to content

Commit

Permalink
Fix: Bug reported by the clang static analyzer.
Browse files Browse the repository at this point in the history
Description: Access to field 'data' results in a dereference of a null pointer (loaded from variable 'current')
File: /home/jnicola/dev/openvas/nasl/lint.c
Line: 424
  • Loading branch information
jjnicola committed Oct 21, 2022
1 parent ab20dab commit 099487d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions nasl/lint.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,10 @@ is_deffunc_used (const char *funcname, const char *filename,
{
func_info *element;
GSList *current = def_func_tree;

if (current == NULL)
return 0;

do
{
element = current->data;
Expand Down

0 comments on commit 099487d

Please sign in to comment.