- XML_PARSER: in parse_int(), set errno to zero before calling strtol().

svn path=/trunk/boinc/; revision=16739
This commit is contained in:
David Anderson 2008-12-22 22:22:53 +00:00
parent 7f26875f08
commit cc622c2f4f
2 changed files with 7 additions and 0 deletions

View File

@ -10338,3 +10338,9 @@ David 22 Dec 2008
coproc.cpp,h
sched/
sched_plan.cpp
David 22 Dec 2008
- XML_PARSER: in parse_int(), set errno to zero before calling strtol().
lib/
parse.cpp

View File

@ -642,6 +642,7 @@ bool XML_PARSER::parse_int(char* parsed_tag, const char* start_tag, int& i) {
return false;
}
}
errno = 0;
int val = strtol(buf, &end, 0);
if (errno == ERANGE) return false;
if (end != buf+strlen(buf)) return false;