chiark / gitweb /
networkd: link_object_find - don't accept invalid input
authorTom Gundersen <teg@jklm.no>
Mon, 9 Feb 2015 21:02:32 +0000 (22:02 +0100)
committerTom Gundersen <teg@jklm.no>
Mon, 9 Feb 2015 21:02:32 +0000 (22:02 +0100)
Reported by Zbigniew.

src/network/networkd-link-bus.c

index 370707c..1a1524d 100644 (file)
@@ -101,7 +101,8 @@ int link_object_find(sd_bus *bus, const char *path, const char *interface, void
         if (r < 0)
                 return 0;
 
-        if (sscanf(identifier, "%d", &ifindex) != 1)
+        r = safe_atoi(identifier, &ifindex);
+        if (r < 0)
                 return 0;
 
         r = link_get(m, ifindex, &link);