]> git.sur5r.net Git - u-boot/commitdiff
net: xilinx_ll_temac: Fix string overflow
authorRicardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Tue, 26 Jan 2016 10:24:24 +0000 (11:24 +0100)
committerMichal Simek <michal.simek@xilinx.com>
Wed, 27 Jan 2016 14:57:20 +0000 (15:57 +0100)
Size of this snprintf "lltemac.%lx" is bigger than 16 characters.
Replacing it with "ll_tem.%lx"

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>
drivers/net/xilinx_ll_temac.c

index 7cc86571e4952e001f2d5da234795abd520d223a..ca09546ab59f7f7d4b540eb6903bdacaa9a55815 100644 (file)
@@ -303,7 +303,8 @@ int xilinx_ll_temac_initialize(bd_t *bis, struct ll_temac_info *devinf)
        if (devinf->devname) {
                strncpy(dev->name, devinf->devname, sizeof(dev->name));
        } else {
-               snprintf(dev->name, sizeof(dev->name), "lltemac.%lx", devinf->base_addr);
+               snprintf(dev->name, sizeof(dev->name), "ll_tem.%lx",
+                        devinf->base_addr);
                devinf->devname = dev->name;
        }