summaryrefslogtreecommitdiffstats
path: root/lib/Utils/xatonum.cpp
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-01-11 07:22:13 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2010-01-11 07:22:13 +0100
commit14ef0cfe72faf6696df3ef8f42927e9458ccbeeb (patch)
treec5d3a3169fc31f212d507553beb67920be92ebcd /lib/Utils/xatonum.cpp
parentb1c4304104910c4bc066cd43f9784fe2f3ddf1ad (diff)
downloadabrt-14ef0cfe72faf6696df3ef8f42927e9458ccbeeb.tar.gz
abrt-14ef0cfe72faf6696df3ef8f42927e9458ccbeeb.tar.xz
abrt-14ef0cfe72faf6696df3ef8f42927e9458ccbeeb.zip
*: misc fixes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'lib/Utils/xatonum.cpp')
-rw-r--r--lib/Utils/xatonum.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Utils/xatonum.cpp b/lib/Utils/xatonum.cpp
index b096ca89..83146298 100644
--- a/lib/Utils/xatonum.cpp
+++ b/lib/Utils/xatonum.cpp
@@ -9,7 +9,7 @@
unsigned xatou(const char *numstr)
{
- unsigned r;
+ unsigned long r;
int old_errno;
char *e;
@@ -19,7 +19,7 @@ unsigned xatou(const char *numstr)
old_errno = errno;
errno = 0;
r = strtoul(numstr, &e, 10);
- if (errno || numstr == e || *e != '\0')
+ if (errno || numstr == e || *e != '\0' || r > UINT_MAX)
goto inval; /* error / no digits / illegal trailing chars */
errno = old_errno; /* Ok. So restore errno. */
return r;