Index: lib/libmicrohttpd/src/daemon/connection.c =================================================================== --- lib/libmicrohttpd/src/daemon/connection.c (revision 1099) +++ lib/libmicrohttpd/src/daemon/connection.c (working copy) @@ -1256,6 +1256,7 @@ int instant_retry; int malformed; char *buffer_head; + char *endptr; if (connection->response != NULL) return; /* already queued a response */ @@ -1330,11 +1331,11 @@ if (!malformed) { buffer_head[i] = '\0'; - malformed = - (1 != SSCANF (buffer_head, "%X", - &connection->current_chunk_size)) && - (1 != SSCANF (buffer_head, "%x", - &connection->current_chunk_size)); + connection->current_chunk_size = strtoul(buffer_head, &endptr, 16); + if(buffer_head == endptr) + { + malformed = 1; + } } if (malformed) { @@ -1643,6 +1644,7 @@ parse_connection_headers (struct MHD_Connection *connection) { const char *clen; + char *endptr; unsigned MHD_LONG_LONG cval; struct MHD_Response *response; const char *enc; @@ -1678,7 +1680,8 @@ MHD_HTTP_HEADER_CONTENT_LENGTH); if (clen != NULL) { - if (1 != SSCANF (clen, "%" MHD_LONG_LONG_PRINTF "u", &cval)) + cval = strtoull (clen, &endptr, 10); + if (endptr != clen) { #if HAVE_MESSAGES MHD_DLOG (connection->daemon, Index: lib/libmicrohttpd/src/daemon/internal.c =================================================================== --- lib/libmicrohttpd/src/daemon/internal.c (revision 1099) +++ lib/libmicrohttpd/src/daemon/internal.c (working copy) @@ -122,6 +122,8 @@ char *rpos = val; char *wpos = val; unsigned int num; + char buf[3]; + char *endptr; while ('\0' != *rpos) { @@ -133,10 +135,10 @@ rpos++; break; case '%': - if ( (1 == SSCANF (&rpos[1], - "%2x", &num)) || - (1 == SSCANF (&rpos[1], - "%2X", &num)) ) + strncpy (buf, &rpos[1], 2); + buf[2] = '\0'; + strtoul (buf, &endptr, 16); + if (buf != endptr) { *wpos = (unsigned char) num; wpos++;