View Issue Details

IDProjectCategoryView StatusLast Update
0001281libmicrohttpdHTTP GET/HEADpublic2007-10-11 11:06
Reportereglaysher Assigned ToChristian Grothoff  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version0.1.0 
Summary0001281: MHD_http_unescape does not properly unescape strings with "%xx" characters
DescriptionHello,

When passed a URL with GET arguments that contain a "%xx" construct, such as "index.html?x=One%20Two", MHD_http_unescape will return "One Twowo" because memmove on line 64 of internal.c is not copying the terminating NULL.

Patch attached.
TagsNo tags attached.
Attached Files
libmicrohttpd.patch (477 bytes)   
--- libmicrohttpd-0.1.0-old/src/daemon/internal.c 2007-09-09 16:15:29.000000000 -0500
+++ libmicrohttpd-0.1.0/src/daemon/internal.c  2007-09-27 09:28:02.000000000 -0500
@@ -61,7 +61,7 @@
                         "%2x", &num)) || (1 == sscanf (&esc[1], "%2X", &num)))
         {
           esc[0] = (unsigned char) num;
-          memmove (&esc[1], &esc[3], strlen (&esc[3]));
+          memmove (&esc[1], &esc[3], strlen (&esc[3]) + 1);
         }
       val = esc + 1;
     }
libmicrohttpd.patch (477 bytes)   

Activities

Christian Grothoff

2007-09-27 10:21

manager   ~0003181

Fixed in SVN 5665.

Issue History

Date Modified Username Field Change
2007-09-27 09:19 eglaysher New Issue
2007-09-27 09:19 eglaysher File Added: libmicrohttpd.patch
2007-09-27 10:21 Christian Grothoff Status new => assigned
2007-09-27 10:21 Christian Grothoff Assigned To => Christian Grothoff
2007-09-27 10:21 Christian Grothoff Status assigned => resolved
2007-09-27 10:21 Christian Grothoff Resolution open => fixed
2007-09-27 10:21 Christian Grothoff Note Added: 0003181
2007-10-11 11:06 Christian Grothoff Status resolved => closed
2013-05-06 12:54 Christian Grothoff Category HTTP GET => HTTP GET/HEAD