The Samba-Bugzilla – Attachment 6757 Details for
Bug 8355
Use pointer after freeaddrinfo()
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
patch
patch-socket.c.txt (text/plain), 951 bytes, created by
Andrey Zonov
on 2011-08-05 20:06:14 UTC
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Andrey Zonov
Created:
2011-08-05 20:06:14 UTC
Size:
951 bytes
patch
obsolete
>--- socket.c.orig 2011-01-02 00:55:03.000000000 +0300 >+++ socket.c 2011-08-05 17:44:47.993181297 +0400 >@@ -299,20 +299,32 @@ > } > break; > } >- freeaddrinfo(res0); > > if (s < 0) { >- char buf[2048]; >+ char buf[INET6_ADDRSTRLEN]; > for (res = res0, j = 0; res; res = res->ai_next, j++) { >+ void *addr; > if (errnos[j] == 0) > continue; >- if (inet_ntop(res->ai_family, res->ai_addr->sa_data + 2, buf, sizeof buf) == NULL) >+ >+ switch (res->ai_family) { >+ case AF_INET: >+ addr = &((struct sockaddr_in *)(res->ai_addr))->sin_addr; >+ break; >+#ifdef AF_INET6 >+ case AF_INET6: >+ addr = &((struct sockaddr_in6 *)(res->ai_addr))->sin6_addr; >+ break; >+#endif >+ } >+ if (inet_ntop(res->ai_family, addr, buf, sizeof buf) == NULL) > strlcpy(buf, "*inet_ntop failed*", sizeof buf); > rsyserr(FERROR, errnos[j], "failed to connect to %s (%s)", h, buf); > } > s = -1; > } > >+ freeaddrinfo(res0); > free(errnos); > > return s;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 8355
: 6757