core: use ASSERT_VALID_PATH_COMPONENT

Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
Thomas Haller
2014-03-12 12:49:34 +01:00
parent ec7fc72e67
commit e739e01900
5 changed files with 20 additions and 7 deletions

View File

@@ -1046,6 +1046,9 @@ nm_utils_ip6_property_path (const char *ifname, const char *property)
static char path[sizeof (IPV6_PROPERTY_DIR) + IFNAMSIZ + 32];
int len;
ifname = ASSERT_VALID_PATH_COMPONENT (ifname);
property = ASSERT_VALID_PATH_COMPONENT (property);
len = g_snprintf (path, sizeof (path), IPV6_PROPERTY_DIR "%s/%s",
ifname, property);
g_assert (len < sizeof (path) - 1);