View Issue Details

IDProjectCategoryView StatusLast Update
0001281libmicrohttpdHTTP GET/HEADpublic2007-10-11 09: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 08:21

manager   ~0003181

Fixed in SVN 5665.

Issue History

Date ModifiedUsernameFieldChange
2007-09-27 07:19eglaysherNew Issue
2007-09-27 07:19eglaysherFile Added: libmicrohttpd.patch
2007-09-27 08:21Christian GrothoffStatusnew => assigned
2007-09-27 08:21Christian GrothoffAssigned To => Christian Grothoff
2007-09-27 08:21Christian GrothoffStatusassigned => resolved
2007-09-27 08:21Christian GrothoffResolutionopen => fixed
2007-09-27 08:21Christian GrothoffNote Added: 0003181
2007-10-11 09:06Christian GrothoffStatusresolved => closed
2013-05-06 10:54Christian GrothoffCategoryHTTP GET => HTTP GET/HEAD