This is the mail archive of the glibc-bugs@sourceware.org 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]
Other format: [Raw text]

[Bug libc/18660] Fix overflow in getusershell


https://sourceware.org/bugzilla/show_bug.cgi?id=18660

Paul Pluzhnikov <ppluzhnikov at google dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ppluzhnikov at google dot com

--- Comment #1 from Paul Pluzhnikov <ppluzhnikov at google dot com> ---
> This fix has been applied in OpenBSD.

The fix is wrong: it adds 2 bytes to "shells".
Did you intend to add "2 * sizeof (char *)" ?

It seems to me that even adding 2 * sizeof (char *) is insufficient: if
/etc/shells contains 10 two-byte lines "/\n", then "shells" will point to an
array of 20/3 + 2 == 8 pointers, and we'll try to write 11 entries into it.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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