LWN.net Logo

Format string vulnerabilities

Format string vulnerabilities

Posted Feb 5, 2012 22:25 UTC (Sun) by k8to (subscriber, #15413)
In reply to: Format string vulnerabilities by AndreE
Parent article: Format string vulnerabilities

It's best practice to use argv0 when generating error messages, so that your message reflects the program that was executed, even if it was renamed.

It's better than expecting that the program's name will always match the compiled-in name.

Sure, you get a new input vector, but that text is in your program anyway, and will be evaluated by some code you didn't write. I'm not convinced this is a real problem. Patterns where you allow program generated text to be used as a format string really should be either not used or very very carefully audited.


(Log in to post comments)

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