LWN.net Logo

that smell

that smell

Posted Nov 14, 2012 5:17 UTC (Wed) by ncm (subscriber, #165)
In reply to: Crowding out OpenBSD by abartlet
Parent article: Crowding out OpenBSD

strlcpy? Please tell me you don't actually use that.


(Log in to post comments)

that smell

Posted Nov 14, 2012 11:15 UTC (Wed) by abartlet (subscriber, #3928) [Link]

We do use strlcpy. We moved from safe_strcpy() and the custom wrappers fstrcpy() and pstrcpy() (for fstrings of 256 and pstrings of 1024 bytes) to at least something others have seen before. Natrually, a function called safe_ wasn't really safe (just safe against memory overwrite), but the name made us feel better about it despite having the same issues as strlcpy().

As code is rewritten, most strings are dynamically allocated talloc buffers, but stragglers remain.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds