[U-Boot] [PATCH 6/9] board/matrix_vision/mvblx/sys_eeprom.c: fix buffer overflow

Michael Jones michael.jones at matrix-vision.de
Thu Nov 6 14:50:33 CET 2014


On 11/06/2014 02:03 PM, Wolfgang Denk wrote:
> 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 at denx.de>
> cc: Michael Jones <michael.jones at matrix-vision.de>
> ---
>   board/matrix_vision/mvblx/sys_eeprom.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/board/matrix_vision/mvblx/sys_eeprom.c b/board/matrix_vision/mvblx/sys_eeprom.c
> index 1a2ac8d..db42987 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],
>

Thanks for the fix.

Acked-by: Michael Jones <michael.jones at matrix-vision.de>
-----------------------------------------------------------------
VISION 2014 in Stuttgart | 04.11.2014 - 06.11.2014
Meet us at the VISION show Hall 1 - Stand E12
-----------------------------------------------------------------

MATRIX VISION GmbH, Talstrasse 16, DE-71570 Oppenweiler
Registergericht: Amtsgericht Stuttgart, HRB 271090
Geschaeftsfuehrer: Uwe Furtner, Erhard Meier


More information about the U-Boot mailing list