Skip to content

Commit

Permalink
Fix: Bug reported by the clang static analyzer.
Browse files Browse the repository at this point in the history
This issue was hard to fix, and still not sure if it is the right solution.
Please do a deep review and try running the scan analyzer again without this patch. See the report check if it is the right solution,
or I am introducing a new bug.

Description: Assigned value is garbage or undefined
File: /home/jnicola/dev/openvas/nasl/charcnv.c
Line: 625
  • Loading branch information
jjnicola committed Oct 21, 2022
1 parent ef2340b commit 9dabe7b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nasl/charcnv.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ check_dos_char_slowly_ntlmssp (uint16 c)

len1 = convert_string_ntlmssp (CH_UTF16LE, CH_DOS, &c, 2, buf, sizeof (buf),
False);
if (len1 == 0)
if (len1 <= 0)
{
return 0;
}
Expand Down

0 comments on commit 9dabe7b

Please sign in to comment.