wininet: NULL terminate cookie data in load_persistent_cookie function.

This commit is contained in:
Piotr Caban 2012-12-21 17:06:33 +01:00 committed by Alexandre Julliard
parent 2f35659035
commit a62e3f6442
1 changed files with 2 additions and 1 deletions

View File

@ -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)