summaryrefslogtreecommitdiffstats
path: root/source/l/glibc/patches/CVE-2021-27645.patch
blob: c568dd16b5f2f73b1ab6b59518d31f6411ff8c52 (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--- ./nscd/netgroupcache.c.orig	2021-08-07 13:20:02.459057859 -0500
+++ ./nscd/netgroupcache.c	2021-08-07 13:22:08.983060689 -0500
@@ -248,7 +248,7 @@
 					     : NULL);
 				    ndomain = (ndomain ? newbuf + ndomaindiff
 					       : NULL);
-				    buffer = newbuf;
+				    *tofreep = buffer = newbuf;
 				  }
 
 				nhost = memcpy (buffer + bufused,
@@ -319,7 +319,7 @@
 		    else if (status == NSS_STATUS_TRYAGAIN && e == ERANGE)
 		      {
 			buflen *= 2;
-			buffer = xrealloc (buffer, buflen);
+			*tofreep = buffer = xrealloc (buffer, buflen);
 		      }
 		    else if (status == NSS_STATUS_RETURN
 			     || status == NSS_STATUS_NOTFOUND