mirror of
https://github.com/gryf/wmaker.git
synced 2026-01-03 20:34:14 +01:00
Coverity: fix menuparser_macro uninitialized pointer read
This commit is contained in:
committed by
Carlos R. Mafra
parent
c8883fdbb0
commit
77df89396c
@@ -167,6 +167,7 @@ void menu_parser_define_macro(WMenuParser parser)
|
||||
return;
|
||||
}
|
||||
macro = wmalloc(sizeof(*macro));
|
||||
memset(arg_name, 0, MAX_MACRO_ARG_COUNT * sizeof(char *));
|
||||
|
||||
/* Isolate name of macro */
|
||||
idx = 0;
|
||||
@@ -392,6 +393,8 @@ void menu_parser_expand_macro(WMenuParser parser, WParserMacro *macro)
|
||||
unsigned int size;
|
||||
int i, space_left;
|
||||
|
||||
memset(arg_value, 0, MAX_MACRO_ARG_COUNT * sizeof(char *));
|
||||
|
||||
/* Skip the name of the macro, this was not done by caller */
|
||||
for (i = 0; macro->name[i] != '\0'; i++)
|
||||
parser->rd++;
|
||||
|
||||
Reference in New Issue
Block a user