Blame SOURCES/glibc-rh1646373.patch

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