aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/connection.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/microhttpd/connection.c')
-rw-r--r--src/microhttpd/connection.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index c65315d3..10ac43bf 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -2100,10 +2100,11 @@ parse_connection_headers (struct MHD_Connection *connection)
2100 MHD_HTTP_HEADER_CONTENT_LENGTH); 2100 MHD_HTTP_HEADER_CONTENT_LENGTH);
2101 if (NULL != clen) 2101 if (NULL != clen)
2102 { 2102 {
2103 cval = strtoul (clen, &end, 10); 2103 if (!MHD_str_to_uint64_ (clen, &connection->remaining_upload_size,
2104 if ( ('\0' != *end) || 2104 &end) ||
2105 ( (LONG_MAX == cval) && (errno == ERANGE) ) ) 2105 ('\0' != *end) )
2106 { 2106 {
2107 connection->remaining_upload_size = 0;
2107#ifdef HAVE_MESSAGES 2108#ifdef HAVE_MESSAGES
2108 MHD_DLOG (connection->daemon, 2109 MHD_DLOG (connection->daemon,
2109 "Failed to parse `%s' header `%s', closing connection.\n", 2110 "Failed to parse `%s' header `%s', closing connection.\n",
@@ -2113,7 +2114,6 @@ parse_connection_headers (struct MHD_Connection *connection)
2113 CONNECTION_CLOSE_ERROR (connection, NULL); 2114 CONNECTION_CLOSE_ERROR (connection, NULL);
2114 return; 2115 return;
2115 } 2116 }
2116 connection->remaining_upload_size = cval;
2117 } 2117 }
2118 } 2118 }
2119} 2119}