Incorrect usage of dirname() in sysdep/unix/main.c causes segfault

Ondrej Zajicek santiago at crfreenet.org
Mon Mar 19 12:59:16 CET 2012


On Sun, Mar 18, 2012 at 10:53:32AM -0300, Henrique de Moraes Holschuh wrote:
> According to POSIX, dirname() is allowed to modify the string passed to
> it.  In fact, according to dirname(3), glibc's will do just that when
> libgen.h is in use.  The manpage even warns you that it will segfault
> when passed a constant that cannot be modified...
> 
> Well, I hit that bug and it took a while to track it down.
> --enable-debug seems to link a different dirname() that is less crappy,
> so the bug wouldn't show up in debug builds.
> 
> The attached patch explains it better.

Thanks, merged.

-- 
Elen sila lumenn' omentielvo

Ondrej 'SanTiago' Zajicek (email: santiago at crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20120319/e279d82e/attachment-0001.asc>


More information about the Bird-users mailing list