]> git.sur5r.net Git - u-boot/commitdiff
board/matrix_vision/mvblx/sys_eeprom.c: fix buffer overflow
authorWolfgang Denk <wd@denx.de>
Thu, 6 Nov 2014 13:03:02 +0000 (14:03 +0100)
committerTom Rini <trini@ti.com>
Fri, 7 Nov 2014 21:27:08 +0000 (16:27 -0500)
Fix error detected by cppcheck:

[board/matrix_vision/mvblx/sys_eeprom.c:353]: (error) Buffer is
accessed out of bounds.

Signed-off-by: Wolfgang Denk <wd@denx.de>
cc: Michael Jones <michael.jones@matrix-vision.de>
Acked-by: Michael Jones <michael.jones@matrix-vision.de>
board/matrix_vision/mvblx/sys_eeprom.c

index 1a2ac8d6c8650144da112ded528bd5e2539117d2..db429870102dc24f36330af30eaf0c29f8d34e2d 100644 (file)
@@ -348,7 +348,7 @@ int mac_read_from_eeprom(void)
 
        if (memcmp(&e.mac, "\0\0\0\0\0\0", 6) &&
                memcmp(&e.mac, "\xFF\xFF\xFF\xFF\xFF\xFF", 6)) {
-               char ethaddr[9];
+               char ethaddr[18];
 
                sprintf(ethaddr, "%02X:%02X:%02X:%02X:%02X:%02X",
                        e.mac[0],