Skip to content

Commit

Permalink
Handle null pointers for cookie values in IE
Browse files Browse the repository at this point in the history
Fixes issue #6261.
  • Loading branch information
jimevans committed Aug 8, 2018
1 parent 663edd4 commit 20bdf47
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions cpp/iedriver/CookieManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -524,9 +524,18 @@ LRESULT CALLBACK CookieWndProc(int nCode, WPARAM wParam, LPARAM lParam) {
}
INTERNETCOOKIE2* current_cookie = cookie_pointer + cookie_index;
std::wstring cookie_name = current_cookie->pwszName;
std::wstring cookie_value = current_cookie->pwszValue;
std::wstring cookie_domain = current_cookie->pwszDomain;
std::wstring cookie_path = current_cookie->pwszPath;
std::wstring cookie_value = L"";
if (current_cookie->pwszValue) {
cookie_value = current_cookie->pwszValue;
}
std::wstring cookie_domain = L"";
if (current_cookie->pwszDomain) {
cookie_domain = current_cookie->pwszDomain;
}
std::wstring cookie_path = L"";
if (current_cookie->pwszPath) {
cookie_path = current_cookie->pwszPath;
}
DWORD flags = current_cookie->dwFlags;
FILETIME expires = current_cookie->ftExpires;
all_cookies.append(cookie_name).append(L"\n");
Expand Down

0 comments on commit 20bdf47

Please sign in to comment.