mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-22 18:17:09 +00:00
Fix: backend processing was not treating ${} as a special pcre character
Also for characters that are not recognized as a valid escape seq make sure that the character is emitted. previously \$ resulted in \ where it should have been \$ if $ wasn't recognized Signed-off-by: John Johansen <john.johansen@canonical.com> Acked-by: Steve Beattie <steve@nxnw.org>
This commit is contained in:
parent
80cb9dd67b
commit
7f29e7edee
@ -172,14 +172,15 @@ int regex_lex(YYSTYPE *val, const char **pos)
|
|||||||
return *(*pos - 1);
|
return *(*pos - 1);
|
||||||
|
|
||||||
case '\\':
|
case '\\':
|
||||||
tmp = str_escseq(pos, "*+.|^-[]()");
|
tmp = str_escseq(pos, "*+.|^$-[](){}");
|
||||||
if (tmp == -1)
|
if (tmp == -1) {
|
||||||
/* bad escape sequence, just skip it for now, that
|
/* bad escape sequence, just skip it for now, that
|
||||||
* is output \\ followed by the invalid esc seq
|
* is output \\ followed by the invalid esc seq
|
||||||
* TODO: output error message
|
* TODO: output error message
|
||||||
*/
|
*/
|
||||||
val->c = '\\';
|
val->c = '\\';
|
||||||
else
|
(*pos)--;
|
||||||
|
} else
|
||||||
val->c = tmp;
|
val->c = tmp;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user