From: Wolfgang Denk Date: Thu, 6 Nov 2014 13:03:02 +0000 (+0100) Subject: board/matrix_vision/mvblx/sys_eeprom.c: fix buffer overflow X-Git-Tag: v2015.01-rc1~8 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=cc87d18a6ec74180784a6b1cdafefeacd8eb1bf2;p=u-boot board/matrix_vision/mvblx/sys_eeprom.c: fix buffer overflow 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 cc: Michael Jones Acked-by: Michael Jones --- diff --git a/board/matrix_vision/mvblx/sys_eeprom.c b/board/matrix_vision/mvblx/sys_eeprom.c index 1a2ac8d6c8..db42987010 100644 --- a/board/matrix_vision/mvblx/sys_eeprom.c +++ b/board/matrix_vision/mvblx/sys_eeprom.c @@ -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],