gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r11733 - libmicrohttpd/src/daemon


From: gnunet
Subject: [GNUnet-SVN] r11733 - libmicrohttpd/src/daemon
Date: Sun, 13 Jun 2010 17:11:44 +0200

Author: grothoff
Date: 2010-06-13 17:11:44 +0200 (Sun, 13 Jun 2010)
New Revision: 11733

Modified:
   libmicrohttpd/src/daemon/connection.c
Log:
fix NPE

Modified: libmicrohttpd/src/daemon/connection.c
===================================================================
--- libmicrohttpd/src/daemon/connection.c       2010-06-13 14:53:41 UTC (rev 
11732)
+++ libmicrohttpd/src/daemon/connection.c       2010-06-13 15:11:44 UTC (rev 
11733)
@@ -579,6 +579,7 @@
   enum MHD_ValueKind kind;
   const char *reason_phrase;
 
+  EXTRA_CHECK (NULL != connection->version);
   if (0 == strlen(connection->version))
     {
       data = MHD_pool_allocate (connection->pool, 0, MHD_YES);
@@ -673,7 +674,12 @@
 {
   struct MHD_Response *response;
 
-  /* die, header far too long to be reasonable */
+  if (connection->version == NULL)
+    {
+      /* we were unable to process the full header line, so we don't
+        really know what version the client speaks; assume 1.0 */
+      connection->version = MHD_HTTP_VERSION_1_0;
+    }
   connection->state = MHD_CONNECTION_FOOTERS_RECEIVED;
   connection->read_closed = MHD_YES;
 #if HAVE_MESSAGES




reply via email to

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