glibc/resolv-conf-oom.patch
Andreas Schwab c0dd082d43 Accepting request 529148 from home:Andreas_Schwab:Factory
- assert-pedantic.patch: Suppress pedantic warning caused by statement
  expression (BZ #21242, BZ #21972)
- math-c++-compat.patch: Add more C++ compatibility
- getaddrinfo-errno.patch: Fix errno and h_errno handling in getaddrinfo
  (BZ #21915, BZ #21922)
- resolv-conf-oom.patch: Fix memory handling in OOM situation during
  resolv.conf parsing (BZ #22095, BZ #22096)
- dynarray-enlarge.patch: Fix initial size of dynarray allocation and set
  errno on overflow error
- nearbyint-inexact.patch: Avoid spurious inexact in nearbyint (BZ #22225)

OBS-URL: https://build.opensuse.org/request/show/529148
OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=479
2017-09-28 14:37:11 +00:00

45 lines
1.3 KiB
Diff

2017-09-06 Florian Weimer <fweimer@redhat.com>
[BZ #22096]
* resolv/resolv_conf.c (__resolv_conf_attach): Do not free conf in
case of failure to obtain the global conf object.
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.
Index: glibc-2.26/resolv/res_init.c
===================================================================
--- glibc-2.26.orig/resolv/res_init.c
+++ glibc-2.26/resolv/res_init.c
@@ -446,6 +446,11 @@ res_vinit_1 (FILE *fp, struct resolv_con
(&parser->nameserver_list);
if (p != NULL)
*p = sa;
+ else
+ {
+ free (sa);
+ return false;
+ }
}
continue;
}
Index: glibc-2.26/resolv/resolv_conf.c
===================================================================
--- glibc-2.26.orig/resolv/resolv_conf.c
+++ glibc-2.26/resolv/resolv_conf.c
@@ -600,10 +600,7 @@ __resolv_conf_attach (struct __res_state
struct resolv_conf_global *global_copy = get_locked_global ();
if (global_copy == NULL)
- {
- free (conf);
- return false;
- }
+ return false;
/* Try to find an unused index in the array. */
size_t index;