glibc/gaiconf-init-double-free.patch
Andreas Schwab d6ae5339fb Accepting request 911560 from home:Andreas_Schwab:Factory
- Don't create separate debuginfo packages for cross packages

- ldconfig-leak-empty-paths.patch: ldconfig: avoid leak on empty paths in
  config file
- gconv-parseconfdir-memory-leak.patch: gconv_parseconfdir: Fix memory leak
- gaiconf-init-double-free.patch: gaiconf_init: Avoid double-free in label
  and precedence lists
- copy-and-spawn-sgid-double-close.patch: copy_and_spawn_sgid: Avoid
  double calls to close()
- icon-charmap-close-output.patch: iconv_charmap: Close output file when
  done
- fcntl-time-bits-64-redirect.patch: Linux: Fix fcntl, ioctl, prctl
  redirects for _TIME_BITS=64 (BZ #28182)
- librt-null-pointer.patch: librt: fix NULL pointer dereference (BZ
  #28213)

OBS-URL: https://build.opensuse.org/request/show/911560
OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=603
2021-08-12 08:36:15 +00:00

37 lines
1.1 KiB
Diff

From 77a34079d8f3d63b61543bf3af93043f8674e4c4 Mon Sep 17 00:00:00 2001
From: Siddhesh Poyarekar <siddhesh@sourceware.org>
Date: Tue, 3 Aug 2021 21:11:03 +0530
Subject: [PATCH] gaiconf_init: Avoid double-free in label and precedence lists
labellist and precedencelist could get freed a second time if there
are allocation failures, so set them to NULL to avoid a double-free.
Reviewed-by: Arjun Shankar <arjun@redhat.com>
---
sysdeps/posix/getaddrinfo.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index 838a68f022..43dfc6739e 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -2008,6 +2008,7 @@ gaiconf_init (void)
l = l->next;
}
free_prefixlist (labellist);
+ labellist = NULL;
/* Sort the entries so that the most specific ones are at
the beginning. */
@@ -2046,6 +2047,7 @@ gaiconf_init (void)
l = l->next;
}
free_prefixlist (precedencelist);
+ precedencelist = NULL;
/* Sort the entries so that the most specific ones are at
the beginning. */
--
2.32.0