News for hackers. Stuff that matters.
Re:Remotely Compromising Android and iOS via a bug in Broadc... by corndoge on Wednesday July 26, 2017 @07:51PM (#14861447)
I shot myself in the foot yet I don't blame the manufacturer for not putting a safety on the gun since I'm the one that bought it with full knowledge of the caveats
Re:Remotely Compromising Android and iOS via a bug in Broadc... by MaulingMonkey on Wednesday July 26, 2017 @09:24PM (#14861917)
My experience is that most C programmers don't know about many of the caveats about the C programming language.

Are you aware that atoi("a"); is undefined behavior? It can crash, it can launch nethack, it can return 0.

Re:Remotely Compromising Android and iOS via a bug in Broadc... by corndoge on Wednesday July 26, 2017 @11:06PM (#14862385)
yes I'm aware that parsing a letter as an an integer is undefined behavior, it's in the manual
Re:Remotely Compromising Android and iOS via a bug in Broadc... by MaulingMonkey on Wednesday July 26, 2017 @11:43PM (#14862540)
> yes I'm aware that parsing a letter as an an integer is undefined behavior

Excellent!

> it's in the manual

It's not in MSDN: https://msdn.microsoft.com/en-us/library/yd5xkb5c.aspx

It's not in the manpages: https://linux.die.net/man/3/atoi

Cppreference understates it has having an undefined return value, rather than undefined behavior outright: http://en.cppreference.com/w/cpp/string/byte/atoi

Tutorialspoint defines the behavior as returning 0, and fresh2refresh makes no mention of undefined behavior.

My eighth google hit for atoi finally, finally, gets it right: http://pubs.opengroup.org/onlinepubs/9699919799/functions/at...

If you buy or pirate a copy of e.g. the C89 standard, or refer to one of the free draft versions, it's of course properly documented there too. Neither shows up in the first 50 google results, naturally.

And, of course, by google result 9, we're back to square one - incorrectly defining the behavior as being "returning 0": https://en.wikibooks.org/wiki/C_Programming/stdlib.h/atoi

Re:Remotely Compromising Android and iOS via a bug in Broadc... by teraflop on Wednesday July 26, 2017 @07:58PM (#14861489)
If thousands of people were repeatedly making the same mistake, and frequently shooting other innocent bystanders' feet, I would definitely put some blame on the manufacturer.
Re:Remotely Compromising Android and iOS via a bug in Broadc... by corndoge on Wednesday July 26, 2017 @11:09PM (#14862397)
the parents analogy is quite bad since C doesn't shoot you in the foot unless you pull the trigger

closer to a gun without a safety, which plenty of manufacturers sell

Re:Remotely Compromising Android and iOS via a bug in Broadc... by simonh on Wednesday July 26, 2017 @08:46PM (#14861731)
That doesn't mean that gun is well designed or worth buying and using. Criticising the lack of such a valuable or even essential feature and advising people not to use it would be fair comment. Right?
Re:Remotely Compromising Android and iOS via a bug in Broadc... by corndoge on Wednesday July 26, 2017 @11:08PM (#14862394)
never said C was a great language, merely indicated that it's important to distinguish between a mistake made by a programmer and a failure of the language

pretty sure trusting user provided data without validation is the programmers fault regardless of language

Re:Remotely Compromising Android and iOS via a bug in Broadc... by sbierwagen on Wednesday July 26, 2017 @09:16PM (#14861881)
You consented to it, sure. This bug affected millions of phones. It's more like a car manufacturer decided to put a particular explode-y gas tank in a car, because it provided greater performance.
Re:Remotely Compromising Android and iOS via a bug in Broadc... by corndoge on Wednesday July 26, 2017 @11:04PM (#14862378)
and they put a note in the manual that says "if you drive over 70mph on a hot day it will definitely explode so don't do that"

so if you buy that car and you do that, it's your fault regardless of how poor the car design is

Re:Remotely Compromising Android and iOS via a bug in Broadc... by MaulingMonkey on Wednesday July 26, 2017 @11:52PM (#14862571)
There's likely to be a government mandated recall if your car "spontaneously" explodes - some designs are so poor they fail to meet entirely reasonably regulatory standards. Burying the lede in the fine print is not a get out of jail free card for obvious reasons.