This is the mail archive of the libc-hacker@sourceware.cygnus.com 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]

Re: getXXent.c endless loop



Hello,

> 
> Thorsten Kukuk <kukuk@weber-eb.uni-paderborn.de> writes:
> 
> > In nss/getXXent.c, there is a bug: If we need once more memory,  errno is set
> > to ERANGE., but never set back.  If we have read the last entry, errno is
> > ERANGE, and we will allocate all available memory.
> 
> Which backend?  The clean solution for this is to set errno in the
> backends whenever they return errors.  I.e., if the error is caused by
> something different than a buffer overflow errno should be set to a
> value != ERANGE.

With all backends. The problem is, that there is no error. We have no
more entrys, and returns. But errno is set to ERANGE from an earlier
to small buffer, and getXXent thinks we need more memory.

   Thorsten
-- 
Thorsten Kukuk  kukuk@vt.uni-paderborn.de
                http://www-vt.uni-paderborn.de/~kukuk
Linux is like a Vorlon.  It is incredibly powerful, gives terse,
cryptic answers and has a lot of things going on in the background.


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