Bugzilla bug 219104: handle sockaddr structures that have a sa_len field.

That field should not be copied to PRNetAddr's.  The patch is contributed
by David Baron <dbaron@mozilla.org>.  r=wtc.
This commit is contained in:
wtc%netscape.com 2003-09-13 13:41:29 +00:00
Родитель 8207e6f067
Коммит c2f55f5a37
1 изменённых файлов: 1 добавлений и 0 удалений

Просмотреть файл

@ -2135,6 +2135,7 @@ PR_IMPLEMENT(void *) PR_EnumerateAddrInfo(void *iterPtr,
if (ai) {
/* copy sockaddr to PRNetAddr */
memcpy(result, ai->ai_addr, ai->ai_addrlen);
result->raw.family = ai->ai_addr->sa_family;
if (ai->ai_addrlen < sizeof(PRNetAddr))
memset(((char*)result)+ai->ai_addrlen, 0, sizeof(PRNetAddr) - ai->ai_addrlen);