mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-31 06:16:03 +00:00
fix: pass through escape sequences that result in aare special chars
escape sequences that result in special character that will be interpreted by later processing need to be passed through as well. Eg. previously \\ was fixed to be passed through, but other chars get interpretted as well. *?[]{} and ^, in character classes Signed-off-by: John Johansen <john.johansen@canonical.com> Acked-by: Steve Beattie <steve@nxnw.org>
This commit is contained in:
@@ -459,12 +459,13 @@ char *processunquoted(const char *string, int len)
|
||||
long c;
|
||||
if (*string == '\\' && len > 1 &&
|
||||
(c = strn_escseq(&pos, "", len)) != -1) {
|
||||
/* catch \\ or \134 and pass it through to be handled
|
||||
* by the backend pcre conversion
|
||||
/* catch \\ or \134 and other aare special chars and
|
||||
* pass it through to be handled by the backend
|
||||
* pcre conversion
|
||||
*/
|
||||
if (c == '\\') {
|
||||
*s++ = '\\';
|
||||
if (strchr("*?[]{}^,\\", c) != NULL) {
|
||||
*s++ = '\\';
|
||||
*s++ = c;
|
||||
} else
|
||||
*s++ = c;
|
||||
len -= pos - string;
|
||||
|
Reference in New Issue
Block a user