Commit 469b8770 authored by ttuttle's avatar ttuttle Committed by Commit bot

ReadIpHelper: Zero out before calling GetAdaptersAddresses

This is a first-ditch attempt at fixing http://crbug.com/401655.

BUG=401655

Review URL: https://codereview.chromium.org/539313002

Cr-Commit-Position: refs/heads/master@{#293610}
parent ed9456ec
......@@ -123,6 +123,7 @@ scoped_ptr<IP_ADAPTER_ADDRESSES, base::FreeDeleter> ReadIpHelper(ULONG flags) {
for (unsigned tries = 0; (tries < 3) && (rv == ERROR_BUFFER_OVERFLOW);
tries++) {
out.reset(static_cast<PIP_ADAPTER_ADDRESSES>(malloc(len)));
memset(out.get(), 0, len);
rv = GetAdaptersAddresses(AF_UNSPEC, flags, NULL, out.get(), &len);
}
if (rv != NO_ERROR)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment