Created
February 22, 2016 00:32
-
-
Save jrmoserbaltimore/4a8de746160c4ccd2f96 to your computer and use it in GitHub Desktop.
Ways to misread an if statement if you're blind and stupid
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hashOut.data = hashes + SSL_MD5_DIGEST_LEN; | |
hashOut.length = SSL_SHA1_DIGEST_LEN; | |
if ((err = SSLFreeBuffer(&hashCtx)) != 0) | |
goto fail; | |
if ((err = ReadyHash(&SSLHashSHA1, &hashCtx)) != 0) | |
goto fail; | |
if ((err = SSLHashSHA1.update(&hashCtx, &clientRandom)) != 0) | |
goto fail; | |
if ((err = SSLHashSHA1.update(&hashCtx, &serverRandom)) != 0) | |
goto fail; | |
if ((err = SSLHashSHA1.update(&hashCtx, &signedParams)) != 0) | |
{ | |
goto fail; | |
} | |
goto fail; /* MISTAKE! THIS LINE SHOULD NOT BE HERE */ | |
if ((err = SSLHashSHA1.final(&hashCtx, &hashOut)) != 0) | |
goto fail; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment