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/12782] POSIX strerror_r quality of implementation


http://sourceware.org/bugzilla/show_bug.cgi?id=12782

Bruno Haible <bruno at clisp dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bruno at clisp dot org

--- Comment #3 from Bruno Haible <bruno at clisp dot org> 2011-05-21 17:21:18 UTC ---
The new code at
http://sourceware.org/git/?p=glibc.git;a=blob;f=string/xpg-strerror.c;h=00256c3dac2591e99b504c97b05945e27aefecce;hb=7ea72f99966a65a56aedba817ee2413ff9b1f23c
has three flaws:

- It overwrites buf[0] when buflen == 0. This is an out-of-bounds access.

- If errnum is invalid, it wastes time calling __strerror_r and strlen
  before then returning EINVAL and ignoring the result of __strerror_r.

- It includes <libintl.h> and <locale.h> and defines dgettext(), although
  these are not needed any more, because the localization is now done by
  __strerror_r.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- 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]