diff options
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; |
