News for hackers. Stuff that matters.
Re:About the security content of iOS 7.0.6 by PhantomGremlin on Saturday February 22, 2014 @04:55AM (#7281613)
Here's a little bit of a conspiracy theory for you. There's an old saying: "there are no coincidences on Wall Street". Not with the amounts of money that are involved.

I think something similar should apply to critical security code. This reminds me of when someone tried to add the following to the Linux kernel:

if ((options == (__WCLONE|__WALL)) && (current->uid = 0)) retval = -EINVAL;

Oops, is that "uid == 0", or is that "uid = 0"? Yet another "typo" that couldn't happen in Python.

Re:About the security content of iOS 7.0.6 by hahainternet on Saturday February 22, 2014 @08:17AM (#7281977)
How could this not happen in Python?
Re:About the security content of iOS 7.0.6 by nickbauman on Saturday February 22, 2014 @12:26PM (#7282743)
Good question, even though Python doesn't allow assignment in an expression, but for this reason I put the constant on the left side of the comparison no matter what language I use.
Re:About the security content of iOS 7.0.6 by manojlds on Saturday February 22, 2014 @08:26AM (#7281999)
Because assigning in if would be a syntax error in Python.
Re:About the security content of iOS 7.0.6 by PhantomGremlin on Saturday February 22, 2014 @08:28AM (#7282004)
Python does not allow an assignment to occur within an expression. They deliberately chose that restriction, to avoid that hard-to-see bug.
Re:About the security content of iOS 7.0.6 by nuxi on Saturday February 22, 2014 @04:32PM (#7283711)
True, but in languages with operator overloading you (may) end up with other issues. Unless you look at the source you have no idea what the '==' operator will do.
Re:About the security content of iOS 7.0.6 by staticfish on Saturday February 22, 2014 @12:47PM (#7282816)
I have always wondered why all languages don't enforce this?
Re:About the security content of iOS 7.0.6 by joveian on Saturday February 22, 2014 @04:37PM (#7283732)
Because it is often really convenient, particularly with a simple macro preprocessor like cpp but in other circumstances too. I like gcc's approach of forcing you (if you have the right warning enabled) to put an extra pair of unnecessary parentheses around assignments in expressions.
Re:About the security content of iOS 7.0.6 by cnvogel on Saturday February 22, 2014 @04:38PM (#7283738)
because, for example in C, such a incompatible change would alienate most developers used to the very ideomatic

        if((val = function(args)) != expected)
            return val;
Re:About the security content of iOS 7.0.6 by lectrick on Sunday February 23, 2014 @10:01AM (#7286058)
A better solution is gcc's which forces you (if you enable the restriction) to put an extra pair of parens around inline assignments.
Re:About the security content of iOS 7.0.6 by dspeyer on Thursday February 27, 2014 @12:44PM (#7313606)
The parenthesis in this attack are sufficient to prevent that warning.