mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 08:24:42 +01:00
parser - fix unbalanced ']' issue
A bug existed in the parser that it would not detect the error case where an unquoted ']' is given without a matching '[' (the quoted cases are accepted properly). This patch fixes the issue. Signed-off-by: Steve Beattie <steve@nxnw.org> Acked-by: John Johansen <john.johansen@canonical.com> Acked-by: Seth Arnold <seth.arnold@canonical.com>
This commit is contained in:
parent
055b68289c
commit
61aebaeb4c
1 changed files with 4 additions and 0 deletions
|
@ -236,6 +236,10 @@ static pattern_t convert_aaregex_to_pcre(const char *aare, int anchor,
|
|||
/* ] is a PCRE special character */
|
||||
STORE("\\]", dptr, 2);
|
||||
} else {
|
||||
if (incharclass == 0) {
|
||||
error = e_parse_error;
|
||||
PERROR(_("%s: Regex grouping error: Invalid close ], no matching open [ detected\n"), progname);
|
||||
}
|
||||
incharclass = 0;
|
||||
STORE(sptr, dptr, 1);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue