From 77df89396c1878786387d29548afd1b75756db3f Mon Sep 17 00:00:00 2001 From: David Maciejak Date: Wed, 1 Mar 2023 06:03:04 +0800 Subject: [PATCH] Coverity: fix menuparser_macro uninitialized pointer read --- WINGs/menuparser_macros.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/WINGs/menuparser_macros.c b/WINGs/menuparser_macros.c index aca0bf5f..8c12f2de 100644 --- a/WINGs/menuparser_macros.c +++ b/WINGs/menuparser_macros.c @@ -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++;