olga / rpms / glibc

Forked from rpms/glibc 5 years ago
Clone

Blame SOURCES/glibc-rh1646373.patch

00db10
commit bd3b0fbae33a9a4cc5e2daf049443d5cf03d4251
00db10
Author: Andreas Schwab <schwab@suse.de>
00db10
Date:   Mon Nov 5 12:47:30 2018 +0100
00db10
00db10
    libanl: properly cleanup if first helper thread creation failed (bug 22927)
00db10
00db10
2018-11-05  Andreas Schwab  <schwab@suse.de>
00db10
00db10
	[BZ #22927]
00db10
	* resolv/gai_misc.c (__gai_enqueue_request): Don't crash if
00db10
	creating the first helper thread failed.
00db10
00db10
[Note from DJ - hard to test; must force second calloc() call in
00db10
getaddrinfo_a() to return NULL/ENOMEM]
00db10
00db10
diff -rup a/resolv/gai_misc.c b/resolv/gai_misc.c
00db10
--- a/resolv/gai_misc.c	2012-12-24 22:02:13.000000000 -0500
00db10
+++ b/resolv/gai_misc.c	2019-01-22 16:19:30.514199534 -0500
00db10
@@ -264,8 +264,11 @@ __gai_enqueue_request (struct gaicb *gai
00db10
 	      /* We cannot create a thread in the moment and there is
00db10
 		 also no thread running.  This is a problem.  `errno' is
00db10
 		 set to EAGAIN if this is only a temporary problem.  */
00db10
-	      assert (lastp->next == newp);
00db10
-	      lastp->next = NULL;
00db10
+	      assert (requests == newp || lastp->next == newp);
00db10
+	      if (lastp != NULL)
00db10
+		lastp->next = NULL;
00db10
+	      else
00db10
+		requests = NULL;
00db10
 	      requests_tail = lastp;
00db10
 
00db10
 	      newp->next = freelist;