mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-04 11:00:18 +01:00
libnm: don't cunescape \x00 encoding in nm_udev_utils_property_decode()
UDev never creates such invalid escape sequences. Anyway, we cannot accept a NUL character at this point. Just take the ill escape verbatim -- it should never happen anyway.
This commit is contained in:
parent
9594ee6e69
commit
c15eae92c0
1 changed files with 4 additions and 3 deletions
|
|
@ -67,8 +67,9 @@ nm_udev_utils_property_decode (const char *uproperty, char **to_free)
|
|||
if ( p[0] == '\\'
|
||||
&& p[1] == 'x'
|
||||
&& (a = g_ascii_xdigit_value (p[2])) >= 0
|
||||
&& (b = g_ascii_xdigit_value (p[3])) >= 0) {
|
||||
if (!unescaped) {
|
||||
&& (b = g_ascii_xdigit_value (p[3])) >= 0
|
||||
&& (a || b)) {
|
||||
if (!n) {
|
||||
gssize l = p - uproperty;
|
||||
|
||||
unescaped = g_malloc (l + strlen (p) + 1 - 3);
|
||||
|
|
@ -84,7 +85,7 @@ nm_udev_utils_property_decode (const char *uproperty, char **to_free)
|
|||
}
|
||||
}
|
||||
|
||||
if (!unescaped) {
|
||||
if (!n) {
|
||||
*to_free = NULL;
|
||||
return uproperty;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue