ComputingGuide
Member
- Joined
- Feb 28, 2014
- Messages
- 66
- Gender
- Undisclosed
- HSC
- N/A
An example of problems regarding bad style because they did not use braces (Apple SSL bug):Yeah, it's very humbling to go from a couple of hundred lines of code over a few files to something huge.
When it comes to formatting, any good team/company will follow a standard - typically good practice for that whole language. That does include how indenting style and how to tab, but even stuff like naming conventions - there is a whole chapter on it in Code Complete! The interesting thing I found was that in uni the lecturers liked to use compact syntax by omitting braces where possible and stuff like that, but where I work that is considered bad practice as it could cause an oversight or some stupid mistake.
As for debugging, don't know sorry. For the past few years i've usually had the luxury of using compilers which point out syntactic errors, and use VS predominantly now which has a fairly feature rich debugger.
Anyway, I think only half the people in this thread are CompSci/SE majors so rather than hijacking this thread - if you have any other questions just pm me.
. . .
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. IT GETS EXECUTED WITHOUT ANY IF CONDITION*/
if ((err = SSLHashSHA1.final(&hashCtx, &hashOut)) != 0)
goto fail;
err = sslRawVerify(...);
. . .
http://nakedsecurity.sophos.com/201...s-ssl-bug-explained-plus-an-unofficial-patch/
Back to the thread
ENGG1000 isn't that great but don't miss out on the easy marks such as CPR.