From: Peng Fan Date: Tue, 24 Nov 2015 08:54:20 +0000 (+0800) Subject: common: bootm: check return value of strict_strtoul X-Git-Url: http://git.dujemihanovic.xyz/img/sics.gif?a=commitdiff_plain;h=bc3c89b1308281edceb67051a44026545dc7b505;p=u-boot.git common: bootm: check return value of strict_strtoul Before continue, check return value of strict_strtoul. Signed-off-by: Peng Fan Cc: Albert Aribaud Cc: Simon Glass Cc: Jan Kiszka Cc: Joe Hershberger Cc: Hans de Goede Cc: York Sun Cc: Tom Rini Reviewed-by: Simon Glass --- diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c index ee56d7403e..a477cae010 100644 --- a/arch/arm/lib/bootm.c +++ b/arch/arm/lib/bootm.c @@ -290,7 +290,10 @@ static void boot_jump_linux(bootm_headers_t *images, int flag) s = getenv("machid"); if (s) { - strict_strtoul(s, 16, &machid); + if (strict_strtoul(s, 16, &machid) < 0) { + debug("strict_strtoul failed!\n"); + return; + } printf("Using machid 0x%lx from environment\n", machid); }