Sign in to your account



This field is required


forgot your password?


New to the site? Create an account →

Apple’s SSL/TLS bug caused by lack of Curly Braces

tcr! · Feb 25, 2014 at 1:02 pm

ImperialViolet - Apple’s SSL/TLS bug

Note the two goto fail lines in a row. The first one is correctly bound to the if statement but the second, despite the indentation, isn’t conditional at all. The code will always jump to the end from that second goto, err will contain a successful value because the SHA1 update operation was successful and so the signature verification will never fail.

Emphasis mine. Always use curly braces. Always.

I put this in the development docs at work:

What’s the main goal of writing code besides generating output?

READABILITY and the deep understanding that another human being will eventually need to read, use, and debug your code.

Don’t be a lazy rockstar –– think about your fellow developers before you commit.

Sidenote: the codebase that runs this site also powers a handful of work projects.

See also This kind of code drives me nuts.

#apple #devhell

Add a comment

It’d be better if you signed in before commenting


Post



Latest articles for #apple

Jan 19th, 2021 at 12:10:46 pm

Jan 19th, 2021 at 12:10:46 pm

Jan 19, 2021 at 12:10 pm

My Apple Watch keeps telling me to stand and it’s messing with my…

It's the Great Pumpkin (sellout), Charlie Brown

It’s the Great Pumpkin (sellout), Charlie Brown

Oct 21, 2020 at 12:38 pm

It’s the Great Pumpkin, Charlie Brown Won’t Air on Broadcast TV But…

About 28 minutes remaining

About 28 minutes remaining

Oct 2, 2020 at 9:32 am

Good lord, Apple. Why you talk me into doing upgrades this…

New MacBook Pro

New MacBook Pro

Apr 11, 2018 at 5:53 pm

Finally got a new machine since the 2012 MacBook Air I’ve…