4 ms·
Isn't that out of scope of the challenge? It's a security challenge -- you've got a project that's not created by yourself and you can't assume that the program
by viraptor 17y ago
Isn't that out of scope of the challenge? It's a security challenge -- you've got a project that's not created by yourself and you can't assume that the programmer was sane either.
Isn't that what security researchers sometimes have to face -- horrid code that's used by thousands of people anyways? They're not there to judge whether it's nice and properly indented or not, only if it's exploitable...
Also, in C++ NULL == 0, it doesn't matter if you use the defined value or not.
- icefox 17y agoOn the topic of NULL the Stroustrup answer: http://www.research.att.com/~bs/bs_faq2.html#null http://www.research.att.com/~bs/bs_faq2.html#null Really it is just another hint that this is made by a C programmer.
- tptacek 17y agoYes, plenty of development teams are populated by programmers that treat C++ as "C with basic_string and vector". Chris' example here is a distillate of some actual code he reviewed.
- 0wned 17y agoAnd that's OK. The high-level OOP stuff is there if you need/want it, but unlike Java, no one is trying to force that mindset down your throat. There is nothing wrong with C-like C++ code. Nothing at all.
- copper 17y agoThere is nothing wrong with C-like C++ code. Nothing at all. On the other hand, recognising that C and C++ treat 'unsigned' differently, and that certain C code may be wrong C++ code... A C/C++ coder who does not recognise that C++/C have different behaviour in certain cases is not much of a coder. (Hm, I believe that's actually one of the rare occasions when saying C/C++ is correct.) I assume that's the bug in this code - it's neither idiomatic C++, nor is it C, but written in a manner that brings out the neatfreak in me. Chris and Thomas: something like coverity should catch this particular bug without trouble. Have you guys verified this?