gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r21922 - gnunet/src/gns


From: gnunet
Subject: [GNUnet-SVN] r21922 - gnunet/src/gns
Date: Tue, 12 Jun 2012 18:37:56 +0200

Author: schanzen
Date: 2012-06-12 18:37:56 +0200 (Tue, 12 Jun 2012)
New Revision: 21922

Modified:
   gnunet/src/gns/gnunet-gns-proxy.c
Log:
-fix html detection

Modified: gnunet/src/gns/gnunet-gns-proxy.c
===================================================================
--- gnunet/src/gns/gnunet-gns-proxy.c   2012-06-12 16:23:48 UTC (rev 21921)
+++ gnunet/src/gns/gnunet-gns-proxy.c   2012-06-12 16:37:56 UTC (rev 21922)
@@ -40,7 +40,7 @@
 /* MHD/cURL defines */
 #define BUF_WAIT_FOR_CURL 0
 #define BUF_WAIT_FOR_MHD 1
-#define HTML_HDR_CONTENT "Content-Type: text/html\r\n"
+#define HTML_HDR_CONTENT "Content-Type: text/html"
 
 /* regexp */
 //#define RE_DOTPLUS "<a href=\"http://(([A-Za-z]+[.])+)([+])"
@@ -373,10 +373,14 @@
 {
   size_t bytes = size * nmemb;
   struct ProxyCurlTask *ctask = cls;
-  char hdr[bytes+1];
+  int len = strlen (HTML_HDR_CONTENT);
+  char hdr[len+1];
+  
+  if ( (len+1) > bytes)
+    return bytes;
 
-  memcpy (hdr, buffer, bytes);
-  hdr[bytes] = '\0';
+  memcpy (hdr, buffer, len);
+  hdr[len] = '\0';
 
   if (0 == strcmp (hdr, HTML_HDR_CONTENT))
   {




reply via email to

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