From 3c4cd6c10f192684fbb31db0d0de7e580fc9c3a8 Mon Sep 17 00:00:00 2001 From: Packit Service Date: Mar 14 2021 14:57:08 +0000 Subject: Apply patch glibc-rh1631293-1.patch patch_name: glibc-rh1631293-1.patch present_in_specfile: true location_in_specfile: 29 --- diff --git a/sysdeps/unix/sysv/linux/gethostid.c b/sysdeps/unix/sysv/linux/gethostid.c index 2e20f03..ee0190e 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;