• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: unsafe printing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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:

https://en.wikipedia.org/wiki/Uncontrolled_format_string

—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

References: 
 >Re: unsafe printing (From: Steve Mills <email@hidden>)

  • Prev by Date: Re: unsafe printing
  • Next by Date: Re: unsafe printing
  • Previous by thread: Re: unsafe printing
  • Next by thread: Re: unsafe printing
  • Index(es):
    • Date
    • Thread