This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] nss_dns: Fix assertion failure in _nss_dns_getcanonname_r [BZ #19865]


As explained in the bug, this function seems to be dead code in typical
configurations, so there does not seem to be any security impact.

Florian
2016-03-25  Florian Weimer  <fweimer@redhat.com>

	[BZ #19865]
	* resolv/nss_dns/dns-canon.c (_nss_dns_getcanonname_r): Restore
	original buffer before retry.

diff --git a/resolv/nss_dns/dns-canon.c b/resolv/nss_dns/dns-canon.c
index 5c5c6db..072104f 100644
--- a/resolv/nss_dns/dns-canon.c
+++ b/resolv/nss_dns/dns-canon.c
@@ -154,6 +154,13 @@ _nss_dns_getcanonname_r (const char *name, char *buffer, size_t buflen,
 	      ptr += rdatalen;
 	    }
 	}
+
+      /* Restore original buffer before retry.  */
+      if (ansp.ptr != buf)
+	{
+	  free (ansp.ptr);
+	  ansp.ptr = buf;
+	}
     }
 
  out:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]