002-1.2.0-0002-upnphttp-Kill-strange-HTTP-request-parsing.patch 855 B

1234567891011121314151617181920212223242526272829303132
  1. From 8a996b4b624ef45538a5de10730b8e94c55e7768 Mon Sep 17 00:00:00 2001
  2. From: Justin Maggard <jmaggard@netgear.com>
  3. Date: Wed, 28 Sep 2016 18:44:58 -0700
  4. Subject: [PATCH] upnphttp: Kill strange HTTP request parsing
  5. Avoid reading uninitialized memory on malicious HTTP requests.
  6. Fixes: Bug #293 - upnphttp.c ProcessHttpQuery_upnphttp() Function HTTP Request Handling Remote DoS
  7. ---
  8. upnphttp.c | 6 ------
  9. 1 file changed, 6 deletions(-)
  10. diff --git a/upnphttp.c b/upnphttp.c
  11. index 4184bb2..1902159 100644
  12. --- a/upnphttp.c
  13. +++ b/upnphttp.c
  14. @@ -827,12 +827,6 @@ ProcessHttpQuery_upnphttp(struct upnphttp * h)
  15. HttpCommand[i] = '\0';
  16. while(*p==' ')
  17. p++;
  18. - if(strncmp(p, "http://", 7) == 0)
  19. - {
  20. - p = p+7;
  21. - while(*p!='/')
  22. - p++;
  23. - }
  24. for(i = 0; i<511 && *p && *p != ' ' && *p != '\r'; i++)
  25. HttpUrl[i] = *(p++);
  26. HttpUrl[i] = '\0';
  27. --
  28. 2.11.0