From: Ulrich Drepper Date: Mon, 13 Dec 2004 21:50:20 +0000 (+0000) Subject: Update. X-Git-Tag: cvs/fedora-glibc-20041213T2323 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e1b27ffbf604546725eca78ef498b88fd60c4f42;p=platform%2Fupstream%2Fglibc.git Update. 2004-12-13 Ulrich Drepper * nss/getnssent.c (__nss_getent): Double buffer size each round to avoid problems with delays for some people's huge entries. * nss/getXXbyYY.c (FUNCTION_NAME): Likewise. --- diff --git a/ChangeLog b/ChangeLog index 0a499e4..229faa3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-12-13 Ulrich Drepper + + * nss/getnssent.c (__nss_getent): Double buffer size each round to + avoid problems with delays for some people's huge entries. + * nss/getXXbyYY.c (FUNCTION_NAME): Likewise. + 2004-12-13 Jakub Jelinek * posix/getconf.c (main): Prepend just $GETCONF_DIR/ instead of diff --git a/nss/getXXbyYY.c b/nss/getXXbyYY.c index 854a3e8..dd0ac84 100644 --- a/nss/getXXbyYY.c +++ b/nss/getXXbyYY.c @@ -123,7 +123,7 @@ FUNCTION_NAME (ADD_PARAMS) ) { char *new_buf; - buffer_size += BUFLEN; + buffer_size *= 2; new_buf = (char *) realloc (buffer, buffer_size); if (new_buf == NULL) { diff --git a/nss/getnssent.c b/nss/getnssent.c index a56d34d..1f7573d 100644 --- a/nss/getnssent.c +++ b/nss/getnssent.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -38,7 +38,7 @@ __nss_getent (getent_r_function func, void **resbuf, char **buffer, && (h_errnop == NULL || *h_errnop == NETDB_INTERNAL)) { char *new_buf; - *buffer_size += buflen; + *buffer_size *= 2; new_buf = realloc (*buffer, *buffer_size); if (new_buf == NULL) {