From 5eb11aa8ec4e402b3e5795723519cdaab1cfb828 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 17 May 2017 16:45:46 +0200 Subject: [PATCH] libnm: fix unterminated NUL string when parsing UDev properties This can result in trailing garbage (which fails UTF-8 validation checks) or even worse, in read-out-of-bounds. Fixes: 6808bf8195d427975638610781f8c5384228218d https://bugzilla.redhat.com/show_bug.cgi?id=1443114 https://bugzilla.redhat.com/show_bug.cgi?id=1451160 https://bugzilla.redhat.com/show_bug.cgi?id=1451286 (cherry picked from commit 9594ee6e6921c3e37615a572de7e986274a68500) --- shared/nm-utils/nm-udev-utils.c | 1 + 1 file changed, 1 insertion(+) diff --git a/shared/nm-utils/nm-udev-utils.c b/shared/nm-utils/nm-udev-utils.c index bf0ad5b931..1f1811cd9b 100644 --- a/shared/nm-utils/nm-udev-utils.c +++ b/shared/nm-utils/nm-udev-utils.c @@ -89,6 +89,7 @@ nm_udev_utils_property_decode (const char *uproperty, char **to_free) return uproperty; } + *n++ = '\0'; return (*to_free = unescaped); }