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.18-330-g151659f


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  151659f6371ce39a488fd132a5c8ce5e3bba983c (commit)
      from  10b0f26b1950f8d38a5846b80833564df3c5b582 (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://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=151659f6371ce39a488fd132a5c8ce5e3bba983c

commit 151659f6371ce39a488fd132a5c8ce5e3bba983c
Author: OndÅ?ej Bílka <neleai@seznam.cz>
Date:   Fri Oct 25 19:16:08 2013 +0200

    Fix gethostbyname_r example. Fixes bug 2801.

diff --git a/ChangeLog b/ChangeLog
index 3e0e025..c2e5261 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2013-10-25   OndÅ?ej Bílka  <neleai@seznam.cz>
 
+	[BZ 2801]
+	* manual/socket.texi (Host Names): Fix gethostbyname_r example.
+
+2013-10-25   OndÅ?ej Bílka  <neleai@seznam.cz>
+
 	[BZ #14876]
 	* time/strptime_l.c (__strptime_internal): 14876 Read timezone entry.
 	* time/tst-strptime.c (day_tests): Add testcase.
diff --git a/NEWS b/NEWS
index 5055324..0b7e9f7 100644
--- a/NEWS
+++ b/NEWS
@@ -9,14 +9,14 @@ Version 2.19
 
 * The following bugs are resolved with this release:
 
-  156, 431, 832, 10278, 13028, 13982, 13985, 14029, 14155, 14547, 14699,
-  14876, 14910, 15048, 15218, 15277, 15308, 15362, 15400, 15427, 15522,
-  15531, 15532, 15608, 15609, 15610, 15632, 15640, 15670, 15672, 15680,
-  15681, 15723, 15734, 15735, 15736, 15748, 15749, 15754, 15760, 15764,
-  15797, 15825, 15844, 15847, 15849, 15855, 15856, 15857, 15859, 15867,
-  15886, 15887, 15890, 15892, 15893, 15895, 15897, 15905, 15909, 15919,
-  15921, 15923, 15939, 15948, 15963, 15966, 15988, 16032, 16034, 16036,
-  16041, 16072, 16074.
+  156, 431, 832, 2801, 10278, 13028, 13982, 13985, 14029, 14155, 14547,
+  14699, 14876, 14910, 15048, 15218, 15277, 15308, 15362, 15400, 15427,
+  15522, 15531, 15532, 15608, 15609, 15610, 15632, 15640, 15670, 15672,
+  15680, 15681, 15723, 15734, 15735, 15736, 15748, 15749, 15754, 15760,
+  15764, 15797, 15825, 15844, 15847, 15849, 15855, 15856, 15857, 15859,
+  15867, 15886, 15887, 15890, 15892, 15893, 15895, 15897, 15905, 15909,
+  15919, 15921, 15923, 15939, 15948, 15963, 15966, 15988, 16032, 16034,
+  16036, 16041, 16072, 16074.
 
 * CVE-2012-4412 The strcoll implementation caches indices and rules for
   large collation sequences to optimize multiple passes.  This cache
diff --git a/manual/socket.texi b/manual/socket.texi
index 25c35c4..4c7e623 100644
--- a/manual/socket.texi
+++ b/manual/socket.texi
@@ -1307,23 +1307,25 @@ Here's a small example:
 struct hostent *
 gethostname (char *host)
 @{
-  struct hostent hostbuf, *hp;
+  struct hostent *hostbuf, *hp;
   size_t hstbuflen;
   char *tmphstbuf;
   int res;
   int herr;
 
+  hostbuf = malloc (sizeof (struct hostent));
   hstbuflen = 1024;
-  /* Allocate buffer, remember to free it to avoid memory leakage.  */
   tmphstbuf = malloc (hstbuflen);
 
-  while ((res = gethostbyname_r (host, &hostbuf, tmphstbuf, hstbuflen,
+  while ((res = gethostbyname_r (host, hostbuf, tmphstbuf, hstbuflen,
                                  &hp, &herr)) == ERANGE)
     @{
       /* Enlarge the buffer.  */
       hstbuflen *= 2;
       tmphstbuf = realloc (tmphstbuf, hstbuflen);
     @}
+
+  free (tmphstbuf);
   /*  Check for errors.  */
   if (res || hp == NULL)
     return NULL;

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

Summary of changes:
 ChangeLog          |    5 +++++
 NEWS               |   16 ++++++++--------
 manual/socket.texi |    8 +++++---
 3 files changed, 18 insertions(+), 11 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]