From: Karel Zak Date: Mon, 21 Feb 2011 14:35:04 +0000 (+0100) Subject: lib: [strutils.c] more robust strtol checks X-Git-Tag: v2.19.1-rc1~62 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3f2906ccbfcba6bb1ea4ceb1bf633e529ece4dd5;p=thirdparty%2Futil-linux.git lib: [strutils.c] more robust strtol checks Signed-off-by: Karel Zak --- diff --git a/lib/strutils.c b/lib/strutils.c index b63eea4690..a6105489fa 100644 --- a/lib/strutils.c +++ b/lib/strutils.c @@ -177,7 +177,7 @@ long strtol_or_err(const char *str, const char *errmesg) errno = 0; num = strtol(str, &end, 10); - if (errno || (end && *end)) + if (errno || str == end || (end && *end)) goto err; return num;