Re: unsafe printing
Re: unsafe printing
- Subject: Re: unsafe printing
- From: Jens Alfke <email@hidden>
- Date: Fri, 10 Jul 2015 13:47:28 -0700
On Jul 10, 2015, at 1:07 PM, Steve Mills < email@hidden> wrote:
Temporarily turn off the warning:
Yikes, don’t do that!! It’s like throwing away your smoke detector because the low-battery beeping bothers you, instead of replacing the battery.
TL;DR: The format string parameter to printf (and related functions) should ALWAYS be a string constant. (Except in odd cases if you really, really know what you’re doing.)
Format string vulnerabilities are really bad news. They used to be a major source of real-world exploits — bad ones that can allow malicious code execution — until software maintainers wised up and started fixing them. There was a hacking group circa 2006 that spent a month announcing one Mac OS security vulnerability every day; format string vulnerabilities were the largest single cause. That was when Apple started adding this type of warning to first GCC and then Clang.
Read up on them here:
—Jens |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden