gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r37023 - libmicrohttpd/src/microhttpd


From: gnunet
Subject: [GNUnet-SVN] r37023 - libmicrohttpd/src/microhttpd
Date: Mon, 11 Apr 2016 22:07:40 +0200

Author: Karlson2k
Date: 2016-04-11 22:07:39 +0200 (Mon, 11 Apr 2016)
New Revision: 37023

Modified:
   libmicrohttpd/src/microhttpd/connection.c
Log:
parse_connection_headers(): fixed uploading by POST files larger then LONG_MAX

Modified: libmicrohttpd/src/microhttpd/connection.c
===================================================================
--- libmicrohttpd/src/microhttpd/connection.c   2016-04-11 20:07:36 UTC (rev 
37022)
+++ libmicrohttpd/src/microhttpd/connection.c   2016-04-11 20:07:39 UTC (rev 
37023)
@@ -2100,10 +2100,11 @@
                                          MHD_HTTP_HEADER_CONTENT_LENGTH);
       if (NULL != clen)
         {
-          cval = strtoul (clen, &end, 10);
-          if ( ('\0' != *end) ||
-            ( (LONG_MAX == cval) && (errno == ERANGE) ) )
+          if (!MHD_str_to_uint64_ (clen, &connection->remaining_upload_size,
+                                   &end) ||
+              ('\0' != *end) )
             {
+              connection->remaining_upload_size = 0;
 #ifdef HAVE_MESSAGES
               MHD_DLOG (connection->daemon,
                         "Failed to parse `%s' header `%s', closing 
connection.\n",
@@ -2113,7 +2114,6 @@
              CONNECTION_CLOSE_ERROR (connection, NULL);
               return;
             }
-          connection->remaining_upload_size = cval;
         }
     }
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]