Module: wine Branch: master Commit: 6e46e9048f03613c3c5e139a6f8641635e89b6d8 URL: http://source.winehq.org/git/wine.git/?a=commit;h=6e46e9048f03613c3c5e139a6f...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Thu Sep 23 11:48:05 2010 +0200
wininet: Cut of the query string before searching for the filename in CreateUrlCacheEntryW().
Apparently it's possible to receive URLs with e.g. slashes in the query string. I was under the impression those were reserved in the query string, but e.g. Firefox will happily accept them as well.
---
dlls/wininet/urlcache.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/wininet/urlcache.c b/dlls/wininet/urlcache.c index a220e33..2129f42 100644 --- a/dlls/wininet/urlcache.c +++ b/dlls/wininet/urlcache.c @@ -2271,6 +2271,12 @@ BOOL WINAPI CreateUrlCacheEntryW( if (((lpszUrlEnd - lpszUrlName) > 1) && (*(lpszUrlEnd - 1) == '/' || *(lpszUrlEnd - 1) == '\')) lpszUrlEnd--;
+ lpszUrlPart = memchrW(lpszUrlName, '?', lpszUrlEnd - lpszUrlName); + if (!lpszUrlPart) + lpszUrlPart = memchrW(lpszUrlName, '#', lpszUrlEnd - lpszUrlName); + if (lpszUrlPart) + lpszUrlEnd = lpszUrlPart; + for (lpszUrlPart = lpszUrlEnd; (lpszUrlPart >= lpszUrlName); lpszUrlPart--) @@ -2281,10 +2287,6 @@ BOOL WINAPI CreateUrlCacheEntryW( lpszUrlPart++; break; } - else if(*lpszUrlPart == '?' || *lpszUrlPart == '#') - { - lpszUrlEnd = lpszUrlPart; - } } if (!lstrcmpW(lpszUrlPart, szWWW)) {