]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Don't use a variable length buffer
authorRoy Marples <roy@marples.name>
Tue, 25 Feb 2014 14:11:35 +0000 (14:11 +0000)
committerRoy Marples <roy@marples.name>
Tue, 25 Feb 2014 14:11:35 +0000 (14:11 +0000)
dhcpcd.c

index 128726c0ee269eff2d014c057e40e16b3fb2793a..a16cc9d3bac97a6954b0dc55d98875218a37c348 100644 (file)
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -757,7 +757,7 @@ handle_hwaddr(struct dhcpcd_ctx *ctx, const char *ifname,
     const uint8_t *hwaddr, size_t hwlen)
 {
        struct interface *ifp;
-       char buf[hwlen * 3];
+       char buf[sizeof(ifp->hwaddr) * 3];
 
        ifp = find_interface(ctx, ifname);
        if (ifp == NULL)