aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/glibc
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/glibc')
-rw-r--r--meta/recipes-core/glibc/glibc/0001-Linux-gethostid-Check-for-NULL-value-from-gethostbyn.patch38
-rw-r--r--meta/recipes-core/glibc/glibc_2.28.bb1
2 files changed, 39 insertions, 0 deletions
diff --git a/meta/recipes-core/glibc/glibc/0001-Linux-gethostid-Check-for-NULL-value-from-gethostbyn.patch b/meta/recipes-core/glibc/glibc/0001-Linux-gethostid-Check-for-NULL-value-from-gethostbyn.patch
new file mode 100644
index 0000000000..3cf3266ba1
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0001-Linux-gethostid-Check-for-NULL-value-from-gethostbyn.patch
@@ -0,0 +1,38 @@
+From e7d22db29cfdd2f1fb97a70a76fa53d151569945 Mon Sep 17 00:00:00 2001
+From: Mingli Yu <Mingli.Yu@windriver.com>
+Date: Thu, 20 Sep 2018 12:41:13 +0200
+Subject: [PATCH] Linux gethostid: Check for NULL value from gethostbyname_r [BZ #23679]
+
+A NULL value can happen with certain gethostbyname_r failures.
+
+(cherry picked from commit 1214ba06e6771acb953a190091b0f6055c64fd25)
+
+Upstream-Status: Backport [https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=1214ba06e6771acb953a190091b0f6055c64fd25]
+
+Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
+---
+ sysdeps/unix/sysv/linux/gethostid.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/sysdeps/unix/sysv/linux/gethostid.c b/sysdeps/unix/sysv/linux/gethostid.c
+index 2e20f034dc..ee0190e7f9 100644
+--- a/sysdeps/unix/sysv/linux/gethostid.c
++++ b/sysdeps/unix/sysv/linux/gethostid.c
+@@ -102,12 +102,12 @@ gethostid (void)
+ {
+ int ret = __gethostbyname_r (hostname, &hostbuf,
+ tmpbuf.data, tmpbuf.length, &hp, &herr);
+- if (ret == 0)
++ if (ret == 0 && hp != NULL)
+ break;
+ else
+ {
+ /* Enlarge the buffer on ERANGE. */
+- if (herr == NETDB_INTERNAL && errno == ERANGE)
++ if (ret != 0 && herr == NETDB_INTERNAL && errno == ERANGE)
+ {
+ if (!scratch_buffer_grow (&tmpbuf))
+ return 0;
+--
+2.17.1
+
diff --git a/meta/recipes-core/glibc/glibc_2.28.bb b/meta/recipes-core/glibc/glibc_2.28.bb
index df60ba8445..804b7891ec 100644
--- a/meta/recipes-core/glibc/glibc_2.28.bb
+++ b/meta/recipes-core/glibc/glibc_2.28.bb
@@ -47,6 +47,7 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
file://0030-intl-Emit-no-lines-in-bison-generated-files.patch \
file://0031-sysdeps-ieee754-prevent-maybe-uninitialized-errors.patch \
file://0032-soft-fp-ignore-maybe-uninitialized.patch \
+ file://0001-Linux-gethostid-Check-for-NULL-value-from-gethostbyn.patch \
"
NATIVESDKFIXES ?= ""