summaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-02-15 07:58:15 -0500
committerNick Mathewson <nickm@torproject.org>2017-02-15 07:58:15 -0500
commit62f98ad485ac4e05b7680de0b2ed3c5e416c083d (patch)
tree3fd3455641dbcd7361041ae75b4d872251a59970 /src/or
parent1fbff411b2f19da34b5d8021e6680dba42dcbb9e (diff)
parentcb6b3b7cadb641b648577e5d5536735222cc68da (diff)
downloadtor-62f98ad485ac4e05b7680de0b2ed3c5e416c083d.tar.gz
tor-62f98ad485ac4e05b7680de0b2ed3c5e416c083d.zip
Merge branch 'maint-0.2.9'
Diffstat (limited to 'src/or')
-rw-r--r--src/or/routerparse.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index 22c9a61080..574a6464dd 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -4878,6 +4878,7 @@ tor_version_parse(const char *s, tor_version_t *out)
{
char *eos=NULL;
const char *cp=NULL;
+ int ok = 1;
/* Format is:
* "Tor " ? NUM dot NUM [ dot NUM [ ( pre | rc | dot ) NUM ] ] [ - tag ]
*/
@@ -4893,7 +4894,9 @@ tor_version_parse(const char *s, tor_version_t *out)
#define NUMBER(m) \
do { \
- out->m = (int)strtol(cp, &eos, 10); \
+ out->m = (int)tor_parse_uint64(val, 10, 0, INT32_MAX, &ok, &eos); \
+ if (!ok) \
+ return -1; \
if (!eos || eos == cp) \
return -1; \
cp = eos; \