Sourceware Bugzilla – Attachment 11365 Details for
Bug 20874
getaddrinfo_a segfault
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for uninitialized pointers
gai.patch (text/plain), 1.72 KB, created by
George Pee
on 2018-10-25 14:37:27 UTC
(
hide
)
Description:
Patch for uninitialized pointers
Filename:
MIME Type:
Creator:
George Pee
Created:
2018-10-25 14:37:27 UTC
Size:
1.72 KB
patch
obsolete
># https://sourceware.org/bugzilla/show_bug.cgi?id=20874 >diff -rub a/resolv/gai_notify.c b/resolv/gai_notify.c >--- a/resolv/gai_notify.c 2013-08-10 17:52:55.000000000 -0500 >+++ b/resolv/gai_notify.c 2018-10-25 07:59:19.244512224 -0500 >@@ -104,7 +104,8 @@ > while (waitlist != NULL) > { > struct waitlist *next = waitlist->next; >- >+ if (waitlist->counterp) >+ { > if (waitlist->sigevp == NULL) > { > #ifdef DONT_NEED_GAI_MISC_COND >@@ -126,7 +127,7 @@ > this works. */ > free ((void *) waitlist->counterp); > } >- >+ } > waitlist = next; > } > } >diff -rub a/resolv/gai_suspend.c b/resolv/gai_suspend.c >--- a/resolv/gai_suspend.c 2018-10-25 08:03:30.264356705 -0500 >+++ b/resolv/gai_suspend.c 2018-10-25 07:58:23.292546039 -0500 >@@ -39,6 +39,7 @@ > int none = 1; > int result; > >+ memset(&waitlist, 0, sizeof(waitlist)); > /* Request the mutex. */ > pthread_mutex_lock (&__gai_requests_mutex); > >diff -rub a/resolv/getaddrinfo_a.c b/resolv/getaddrinfo_a.c >--- a/resolv/getaddrinfo_a.c 2013-08-10 17:52:55.000000000 -0500 >+++ b/resolv/getaddrinfo_a.c 2018-10-25 08:01:16.308440388 -0500 >@@ -101,6 +101,7 @@ > struct waitlist waitlist[ent]; > int oldstate; > >+ memset(&waitlist, 0, sizeof(waitlist)); > total = 0; > for (cnt = 0; cnt < ent; ++cnt) > if (requests[cnt] != NULL) >@@ -146,13 +146,14 @@ > struct async_waitlist *waitlist; > > waitlist = (struct async_waitlist *) >- malloc (sizeof (struct async_waitlist) >+ calloc (1, sizeof (struct async_waitlist) > + (ent * sizeof (struct waitlist))); > > if (waitlist == NULL) > result = EAI_AGAIN; > else > { >+ > pid_t caller_pid = sig->sigev_notify == SIGEV_SIGNAL ? getpid () : 0; > total = 0; >
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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 20874
: 11365 |
13505