getXXent.c endless loop

Thorsten Kukuk kukuk@weber-eb.uni-paderborn.de
Sun Aug 9 12:53:00 GMT 1998


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.



More information about the Libc-hacker mailing list