File: CVE-2013-7038.diff

package info (click to toggle)
libmicrohttpd 0.9.20-1%2Bdeb7u1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 3,884 kB
  • sloc: ansic: 20,914; sh: 11,423; pascal: 972; makefile: 620
file content (21 lines) | stat: -rw-r--r-- 650 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Author: Christian Grothoff <christian@grothoff.org>
Description: An out-of-bounds memory read flaw was found in the
 MHD_http_unescape() function in libmicrohttpd. This could possibly lead to
 information disclosure or allow a remote attacker to cause an application
 using libmicrohttpd to crash.
Origin: upstream, commit: 31024
--- a/src/daemon/internal.c
+++ b/src/daemon/internal.c
@@ -135,6 +135,12 @@
 	  rpos++;
 	  break;
 	case '%':
+      if ( ('\0' == rpos[1]) ||
+           ('\0' == rpos[2]) )
+        {
+          *wpos = '\0';
+          return wpos - val;
+        }
 	  buf3[0] = rpos[1];
 	  buf3[1] = rpos[2];
 	  buf3[2] = '\0';