about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-10-25 22:22:33 +0000
committerUlrich Drepper <drepper@redhat.com>1999-10-25 22:22:33 +0000
commit31a13ab3f9acaccae1c4b0b3788a56b4b5f5e95b (patch)
tree008064aba22fbdef1d11cbb736cd97445d960343
parent654de60c0091730037a70336d2632bababf5d730 (diff)
downloadglibc-31a13ab3f9acaccae1c4b0b3788a56b4b5f5e95b.tar.gz
glibc-31a13ab3f9acaccae1c4b0b3788a56b4b5f5e95b.tar.xz
glibc-31a13ab3f9acaccae1c4b0b3788a56b4b5f5e95b.zip
Update.
	* resolv/gethnamaddr.c: Account bytes needed for alignment in
	buflen.  Patch by Olaf Kibrch <okir@lst.de>.
-rw-r--r--ChangeLog3
-rw-r--r--resolv/gethnamaddr.c4
2 files changed, 7 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index f7d9880b24..7b26924cff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 1999-10-25  Ulrich Drepper  <drepper@cygnus.com>
 
+	* resolv/gethnamaddr.c: Account bytes needed for alignment in
+	buflen.  Patch by Olaf Kibrch <okir@lst.de>.
+
 	* md5-crypt/md5test.c: Correct names of MD5 functions after
 	removing of public names.
 
diff --git a/resolv/gethnamaddr.c b/resolv/gethnamaddr.c
index 4484b81ce7..7f1b742c4d 100644
--- a/resolv/gethnamaddr.c
+++ b/resolv/gethnamaddr.c
@@ -420,6 +420,10 @@ getanswer(answer, anslen, qname, qtype)
 				buflen -= nn;
 			}
 
+			/* XXX: when incrementing bp, we have to decrement
+			 * buflen by the same amount --okir */
+			buflen -= sizeof(align) - ((u_long)bp % sizeof(align));
+
 			bp += sizeof(align) - ((u_long)bp % sizeof(align));
 
 			if (bp + n >= &hostbuf[sizeof hostbuf]) {