Compiler Optimizations Can Cause Security Problems

As the title states: when writing code, the programmer should take in mind that the compiler optimizations might remove part of the code or change its order.

Also when doing vulnerabilities code review you should take this into account.

Example of a null exception race condition caused by compiler optimization (in c++ or c this might cause a jump to an undesired address when the pointer gets overridden in the race condition):


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s