From 5ea2a1845f3393e91d6d102a8a89f339dd24f467 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Mon, 23 Nov 2020 23:09:18 -0800 Subject: fixes #1358 nni_strtou64 and nni_strtox64 could be replaced with strtoull --- src/supplemental/http/http_server.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/supplemental/http/http_server.c') diff --git a/src/supplemental/http/http_server.c b/src/supplemental/http/http_server.c index 49c236e4..e1f51e52 100644 --- a/src/supplemental/http/http_server.c +++ b/src/supplemental/http/http_server.c @@ -704,8 +704,10 @@ http_sconn_rxdone(void *arg) if ((h->getbody) && ((cls = nni_http_req_get_header(req, "Content-Length")) != NULL)) { uint64_t len; + char *end; - if ((nni_strtou64(cls, &len) != 0) || (len > h->maxbody)) { + len = strtoull(cls, &end, 10); + if ((end == NULL) || (*end != '\0') || (len > h->maxbody)) { nni_mtx_unlock(&s->mtx); http_sconn_error(sc, NNG_HTTP_STATUS_BAD_REQUEST); return; -- cgit v1.2.3-70-g09d2