summary refs log tree commit diff
path: root/resolv/inet_ntop.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2007-04-30 22:30:14 +0000
committerUlrich Drepper <drepper@redhat.com>2007-04-30 22:30:14 +0000
commit37f02b1da57eb6807e849a5056bf973db840dd78 (patch)
tree5e68f223db4b38a8c829f6b6737140acf7b31ee7 /resolv/inet_ntop.c
parent7ecfbd386a340b52b6491f47fcf37f236cc5eaf1 (diff)
downloadglibc-37f02b1da57eb6807e849a5056bf973db840dd78.tar.gz
glibc-37f02b1da57eb6807e849a5056bf973db840dd78.tar.xz
glibc-37f02b1da57eb6807e849a5056bf973db840dd78.zip
[BZ #4439]
2007-04-30  Jakub Jelinek  <jakub@redhat.com>
	[BZ #4439]
	* resolv/inet_ntop.c (inet_ntop4): Take terminating '\0' into
	account in the size check.
	* resolv/tst-inet_ntop.c: New test.
	* resolv/Makefile (tests): Add tst-inet_ntop.
Diffstat (limited to 'resolv/inet_ntop.c')
-rw-r--r--resolv/inet_ntop.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/resolv/inet_ntop.c b/resolv/inet_ntop.c
index e5553a1d3b..1222d08bda 100644
--- a/resolv/inet_ntop.c
+++ b/resolv/inet_ntop.c
@@ -96,7 +96,7 @@ inet_ntop4(src, dst, size)
 	static const char fmt[] = "%u.%u.%u.%u";
 	char tmp[sizeof "255.255.255.255"];
 
-	if (SPRINTF((tmp, fmt, src[0], src[1], src[2], src[3])) > size) {
+	if (SPRINTF((tmp, fmt, src[0], src[1], src[2], src[3])) >= size) {
 		__set_errno (ENOSPC);
 		return (NULL);
 	}