2009-02-06 Ulrich Drepper <drepper@redhat.com>
+ [BZ #9781]
+ * grp/compat-initgroups.c (compat_call): Switch to use malloc when
+ the input line is too long.
+
* po/Makefile (libc.pot): Add f_print as function taking c-format
parameter.
{
struct group grpbuf;
size_t buflen = __sysconf (_SC_GETGR_R_SIZE_MAX);
- char *tmpbuf;
enum nss_status status;
set_function setgrent_fct;
get_function getgrent_fct;
endgrent_fct = __nss_lookup_function (nip, "endgrent");
- tmpbuf = __alloca (buflen);
+ char *tmpbuf = __alloca (buflen);
+ bool use_malloc = false;
+ enum nss_status result = NSS_STATUS_SUCCESS;
do
{
status == NSS_STATUS_TRYAGAIN)
&& *errnop == ERANGE)
{
- buflen *= 2;
- tmpbuf = __alloca (buflen);
+ if (__libc_use_alloca (buflen * 2))
+ tmpbuf = extend_alloca (tmpbuf, buflen, buflen * 2);
+ else
+ {
+ buflen *= 2;
+ char *newbuf = realloc (use_malloc ? tmpbuf : NULL, buflen);
+ if (newbuf == NULL)
+ {
+ result = NSS_STATUS_TRYAGAIN;
+ goto done;
+ }
+ use_malloc = true;
+ tmpbuf = newbuf;
+ }
}
if (status != NSS_STATUS_SUCCESS)
while (status == NSS_STATUS_SUCCESS);
done:
+ if (use_malloc)
+ free (tmpbuf);
+
if (endgrent_fct)
DL_CALL_FCT (endgrent_fct, ());
- return NSS_STATUS_SUCCESS;
+ return result;
}
+2009-02-06 Ulrich Drepper <drepper@redhat.com>
+
+ [BZ #9736]
+ * locales/el_CY: Fix frac_digits and int_frac_digits.
+ * locales/el_GR: Likewise.
+ Patch by Clint Adams <schizo@debian.org>.
+
2009-01-28 Ulrich Drepper <drepper@redhat.com>
[BZ #9791]
{
if (resp->options & RES_INIT) {
if (__res_initstamp != resp->_u._ext.initstamp) {
- if (resp->nscount > 0) {
+ if (resp->nscount > 0)
__res_iclose (resp, true);
- return __res_vinit (resp, 1);
- }
+ return __res_vinit (resp, 1);
}
return 0;
} else if (preinit) {