This is the mail archive of the glibc-cvs@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]

GNU C Library master sources branch, master, updated. glibc-2.14-592-g27deeaf


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  27deeafc3fcb12e2873f05be5c41ccfc6f7b08e8 (commit)
      from  e7f9dac36202cf09e1b4f5f89c56cc12a29ce9f6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=27deeafc3fcb12e2873f05be5c41ccfc6f7b08e8

commit 27deeafc3fcb12e2873f05be5c41ccfc6f7b08e8
Author: Ulrich Drepper <drepper@gmail.com>
Date:   Thu Dec 22 19:21:36 2011 -0500

    Fix error code for too small input buffer to getnameinfo

diff --git a/ChangeLog b/ChangeLog
index e650d53..d49f945 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2011-12-22  Ulrich Drepper  <drepper@gmail.com>
 
+	[BZ #13166]
+	* inet/getnameinfo.c (getnameinfo): Return EAI_OVERFLOW if the
+	buffer for the output is too small.
+
 	* sysdeps/i386/fpu/bits/fenv.h [__SSE_MATH__]: Add feraiseexcept
 	optimization.
 
diff --git a/NEWS b/NEWS
index ea946e3..fe57b58 100644
--- a/NEWS
+++ b/NEWS
@@ -11,10 +11,10 @@ Version 2.15
 
   6779, 6783, 9696, 10103, 10709, 11589, 12403, 12847, 12868, 12852, 12874,
   12885, 12892, 12907, 12922, 12935, 13007, 13021, 13067, 13068, 13090,
-  13092, 13114, 13118, 13123, 13134, 13138, 13147, 13150, 13179, 13185,
-  13189, 13192, 13268, 13276, 13282, 13291, 13305, 13328, 13335, 13337,
-  13344, 13358, 13367, 13413, 13416, 13423, 13439, 13446, 13472, 13484,
-  13506, 13515, 13523, 13524, 13538, 13540
+  13092, 13114, 13118, 13123, 13134, 13138, 13147, 13150, 13166, 13179,
+  13185, 13189, 13192, 13268, 13276, 13282, 13291, 13305, 13328, 13335,
+  13337, 13344, 13358, 13367, 13413, 13416, 13423, 13439, 13446, 13472,
+  13484, 13506, 13515, 13523, 13524, 13538, 13540
 
 * New program pldd to list loaded object of a process
   Implemented by Ulrich Drepper.
diff --git a/inet/getnameinfo.c b/inet/getnameinfo.c
index 6fb6ad6..436604b 100644
--- a/inet/getnameinfo.c
+++ b/inet/getnameinfo.c
@@ -346,10 +346,11 @@ getnameinfo (const struct sockaddr *sa, socklen_t addrlen, char *host,
 						     "%u", scopeid);
 
 			if (real_hostlen + scopelen + 1 > hostlen)
-			  /* XXX We should not fail here.  Simply enlarge
-			     the buffer or return with out of memory.  */
-			  return EAI_SYSTEM;
-			memcpy (host + real_hostlen, scopebuf, scopelen + 1);
+			  /* Signal the buffer is too small.  This is
+			     what inet_ntop does.  */
+			  c = NULL;
+			else
+			  memcpy (host + real_hostlen, scopebuf, scopelen + 1);
 		      }
 		  }
 		else
@@ -357,7 +358,7 @@ getnameinfo (const struct sockaddr *sa, socklen_t addrlen, char *host,
 				 (const void *) &(((const struct sockaddr_in *) sa)->sin_addr),
 				 host, hostlen);
 		if (c == NULL)
-		  return EAI_SYSTEM;
+		  return EAI_OVERFLOW;
 	      }
 	    ok = 1;
 	  }

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog          |    4 ++++
 NEWS               |    8 ++++----
 inet/getnameinfo.c |   11 ++++++-----
 3 files changed, 14 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


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