2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-31 06:16:03 +00:00

parser: fix uninitialized field in convert_aaregex_to_pcre()

The first entry in the grouping_count array is never initialized to 0;
subsequent depths are. This patch initializes the whole array.

Issue found with valgrind.

Signed-off-by: Steve Beattie <steve@nxnw.org> (with improvement from Seth)
Acked-by: Seth Arnold <seth.arnold@canonical.com>
This commit is contained in:
Steve Beattie
2016-01-25 12:48:34 -08:00
parent f0607be838
commit fcafc08500

View File

@@ -121,7 +121,7 @@ pattern_t convert_aaregex_to_pcre(const char *aare, int anchor, int glob,
BOOL bEscape = 0; /* flag to indicate escape */
int ingrouping = 0; /* flag to indicate {} context */
int incharclass = 0; /* flag to indicate [ ] context */
int grouping_count[MAX_ALT_DEPTH];
int grouping_count[MAX_ALT_DEPTH] = {0};
error = e_no_error;
ptype = ePatternBasic; /* assume no regex */