diff options
| author | Garrett D'Amore <garrett@damore.org> | 2020-11-23 23:09:18 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2020-11-23 23:09:18 -0800 |
| commit | 5ea2a1845f3393e91d6d102a8a89f339dd24f467 (patch) | |
| tree | d17d6cd87d1a540e50f2e996924d8e1c92e1c8f0 /src/supplemental/http/http_server.c | |
| parent | d1218d7309475193b53911667911c4f59a1a7752 (diff) | |
| download | nng-5ea2a1845f3393e91d6d102a8a89f339dd24f467.tar.gz nng-5ea2a1845f3393e91d6d102a8a89f339dd24f467.tar.bz2 nng-5ea2a1845f3393e91d6d102a8a89f339dd24f467.zip | |
fixes #1358 nni_strtou64 and nni_strtox64 could be replaced with strtoull
Diffstat (limited to 'src/supplemental/http/http_server.c')
| -rw-r--r-- | src/supplemental/http/http_server.c | 4 |
1 files changed, 3 insertions, 1 deletions
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; |
