security: fix one-byte OOB read in module_args_add_props

A trailing backslash in a module argument string would cause the
escape handling to advance past the null terminator, reading one
byte out of bounds on the next loop iteration.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Wim Taymans 2026-04-29 18:24:13 +02:00
parent c6faaff410
commit 6d2600c09d

View file

@ -147,8 +147,11 @@ void module_args_add_props(struct pw_properties *props, const char *str)
for (e = p; *p ;) { for (e = p; *p ;) {
if (*p == f) if (*p == f)
break; break;
if (*p == '\\') if (*p == '\\') {
p++; p++;
if (*p == '\0')
break;
}
*e++ = *p++; *e++ = *p++;
} }
if (*p != '\0') if (*p != '\0')