From c37ac050efdb8392c234c5f5a300f74cba758dfd Mon Sep 17 00:00:00 2001 From: Packit Date: Aug 21 2020 09:20:53 +0000 Subject: Apply patch glibc-rh1631293-1.patch patch_name: glibc-rh1631293-1.patch location_in_specfile: 29 present_in_specfile: true --- 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;