unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob 6a2e3a85b4e34d147a55661815fb488a266d9345 1693 bytes (raw)
name: gnu/packages/patches/glibc-2-26-0030.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
 
From 905a6129147e7ee80e8918e23efe212433b8cce7 Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Wed, 6 Sep 2017 15:46:54 +0200
Subject: [PATCH 30/90] resolv: Fix memory leak with OOM during resolv.conf
 parsing [BZ #22095]

(cherry picked from commit 5670c4ab256114e869b1df4b05653aa5f909182c)

diff --git a/ChangeLog b/ChangeLog
index fa215c2729..ef2041b9e5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-09-06  Florian Weimer  <fweimer@redhat.com>
+
+	[BZ #22095]
+	* resolv/res_init.c (res_vinit_1): Avoid memory leak in case of
+	dynarray allocation failure.
+
 2017-09-06  Florian Weimer  <fweimer@redhat.com>
 
 	Remove dead PTR IPv4-to-IPv6 mapping code from nss_dns.
diff --git a/NEWS b/NEWS
index 8fbf4241d1..62959274b3 100644
--- a/NEWS
+++ b/NEWS
@@ -28,6 +28,7 @@ The following bugs are resolved with this release:
   [21932] Unpaired __resolv_context_get in generic get*_r implementation
   [21941] powerpc: Restrict xssqrtqp operands to Vector Registers
   [21972] assert macro requires operator== (int) for its argument type
+  [22095] resolv: Fix memory leak with OOM during resolv.conf parsing
 \f
 Version 2.26
 
diff --git a/resolv/res_init.c b/resolv/res_init.c
index fa46ce7813..4e1f9fe8de 100644
--- a/resolv/res_init.c
+++ b/resolv/res_init.c
@@ -446,6 +446,11 @@ res_vinit_1 (FILE *fp, struct resolv_conf_parser *parser)
                     (&parser->nameserver_list);
                   if (p != NULL)
                     *p = sa;
+                  else
+                    {
+                      free (sa);
+                      return false;
+                    }
                 }
               continue;
             }

debug log:

solving 6a2e3a85b ...
found 6a2e3a85b in https://yhetil.org/guix-patches/87ine0pjiu.fsf@fastmail.com/ ||
	https://yhetil.org/guix-patches/87d148pe57.fsf@fastmail.com/

applying [1/1] https://yhetil.org/guix-patches/87ine0pjiu.fsf@fastmail.com/
diff --git a/gnu/packages/patches/glibc-2-26-0030.patch b/gnu/packages/patches/glibc-2-26-0030.patch
new file mode 100644
index 000000000..6a2e3a85b

1:27: trailing whitespace.
 
1:28: space before tab in indent.
 	Remove dead PTR IPv4-to-IPv6 mapping code from nss_dns.
1:40: trailing whitespace.
 
Checking patch gnu/packages/patches/glibc-2-26-0030.patch...
Applied patch gnu/packages/patches/glibc-2-26-0030.patch cleanly.
warning: 3 lines add whitespace errors.

skipping https://yhetil.org/guix-patches/87d148pe57.fsf@fastmail.com/ for 6a2e3a85b
index at:
100644 6a2e3a85b4e34d147a55661815fb488a266d9345	gnu/packages/patches/glibc-2-26-0030.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).