diff options
author | Sean McBride <sean@rogue-research.com> | 2022-10-21 22:15:43 -0400 |
---|---|---|
committer | Sean McBride <sean@rogue-research.com> | 2022-10-27 14:02:44 -0400 |
commit | 1f7a7818841a417651265fd965ad3412c7e0a9cb (patch) | |
tree | c5c97ee43d42d2aef07c68306db6dce49f9f8795 /expat | |
parent | f85fff6e1197f5310cb413bd4be11779425d6965 (diff) | |
download | libexpat-git-1f7a7818841a417651265fd965ad3412c7e0a9cb.tar.gz |
Fixed getDebugLevel handling of empty env var
Reformulated strtoul() error checking to also check if the returned 'afterValue' is set to the beginning of the input sting, which indicates that there were no digits at all.
Diffstat (limited to 'expat')
-rw-r--r-- | expat/lib/xmlparse.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c index a45e3828..eab0f17a 100644 --- a/expat/lib/xmlparse.c +++ b/expat/lib/xmlparse.c @@ -8396,7 +8396,7 @@ getDebugLevel(const char *variableName, unsigned long defaultDebugLevel) { errno = 0; char *afterValue = (char *)value; unsigned long debugLevel = strtoul(value, &afterValue, 10); - if ((errno != 0) || (afterValue[0] != '\0')) { + if ((errno != 0) || (afterValue == value) || (afterValue[0] != '\0')) { errno = 0; return defaultDebugLevel; } |