Skip to content

Commit 96ece43

Browse files
authored
Fix: initialize type value in get_kb_item (#1991)
It may happen, that the value of type is randomly 1, if not initialized, which would force an integer type to the output of `get_kb_item`. This happens rarely, but as the function is called very often during a run and an integer is defined to has at least 16 bits, there is a chance of 1/65536 on each call that this happens. It might lead to different behaviour in some rare cases.
1 parent 7398da0 commit 96ece43

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

nasl/nasl_scanner_glue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ get_kb_item (lex_ctxt *lexic)
717717
char *kb_entry = get_str_var_by_num (lexic, 0);
718718
char *val;
719719
tree_cell *retc;
720-
int type, single = get_int_var_by_num (lexic, 1, 0);
720+
int type = -1, single = get_int_var_by_num (lexic, 1, 0);
721721
size_t len;
722722

723723
if (kb_entry == NULL)

0 commit comments

Comments
 (0)