From a62e3f64425e5f42d6e3bb6357b2a82bf49774a0 Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Fri, 21 Dec 2012 17:06:33 +0100 Subject: [PATCH] wininet: NULL terminate cookie data in load_persistent_cookie function. --- dlls/wininet/cookie.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/wininet/cookie.c b/dlls/wininet/cookie.c index 42c7525405e..0dd93d97b1e 100644 --- a/dlls/wininet/cookie.c +++ b/dlls/wininet/cookie.c @@ -170,11 +170,12 @@ static BOOL load_persistent_cookie(LPCWSTR domain, LPCWSTR path) if(!cookie) return FALSE; - if(!(str = heap_alloc(size)) || !ReadUrlCacheEntryStream(cookie, 0, str, &size, 0)) { + if(!(str = heap_alloc(size+1)) || !ReadUrlCacheEntryStream(cookie, 0, str, &size, 0)) { UnlockUrlCacheEntryStream(cookie, 0); heap_free(str); return FALSE; } + str[size] = 0; UnlockUrlCacheEntryStream(cookie, 0); LIST_FOR_EACH(iter, &domain_list) -- 2.11.4.GIT