getpass fgets check

Denys Vlasenko vda.linux at googlemail.com
Fri Dec 23 13:03:25 UTC 2011


On Tue, Dec 20, 2011 at 8:43 AM, Daniel Wainwright
<wainwright.daniel at gmail.com> wrote:
> Hi,
>
> I believe there is a simple error in getpass.c, line 80:
>
>  static char buf[PWD_BUFFER_SIZE];

I propose the following patch (sorry, it's attached, not inline).

* fixes bogus fgets error check
* fixes bogus strlen() < 0 check
* switches off buffering regardless of tcgetattr() success
* prints newline even on error or if there was no '\n' on input
* uses sizeof(buf) instead of PWD_BUFFER_SIZE

-- 
vda
-------------- next part --------------
A non-text attachment was scrubbed...
Name: getpass.diff
Type: text/x-patch
Size: 2326 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/uclibc/attachments/20111223/f2bbb747/attachment.bin>


More information about the uClibc mailing list