commit 36d82b1a0d34dc1b436abeeae9984b101718086c
parent 665fd0c24a06d0e9798d3593523cd314e2242bfd
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Tue, 12 Apr 2016 14:36:09 +0000
connection.c: used internal US-ASCII-only hex string -> value conversion
Diffstat:
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
@@ -1644,7 +1644,6 @@ process_request_body (struct MHD_Connection *connection)
int instant_retry;
int malformed;
char *buffer_head;
- char *end;
if (NULL != connection->response)
return; /* already queued a response */
@@ -1715,9 +1714,9 @@ process_request_body (struct MHD_Connection *connection)
malformed = (i >= 6);
if (!malformed)
{
- buffer_head[i] = '\0';
- connection->current_chunk_size = strtoul (buffer_head, &end, 16);
- malformed = ('\0' != *end);
+ size_t num_dig = MHD_strx_to_sizet_n_ (buffer_head, i,
+ &connection->current_chunk_size);
+ malformed = (i != num_dig);
}
if (malformed)
{