Hacker Newsnew | past | comments | ask | show | jobs | submitlogin



That commit is just a fixup of the prior which the author probably intended to rebase and squash together.

The actual commit for this vuln is here: https://github.com/Exim/exim/commit/2600301ba6dbac5c9d640c87...


    *(++p) --- what did you think it would do without the parentheses...?
    isdigit(ch) && ch != '8' && ch != '9' --- why not the simpler ch >= '0' && ch <= '7' ?
That code reminds me of FizzBuzz and the huge gap in competence it demonstrates, i.e. a surprisingly large number of "programmers" fail to write correct solutions to the simplest of problems. Perhaps "unescape a string" needs to be an interview question with as much attention as FizzBuzz, both because it has a practical application and can show a lot about someone's skill. Admittedly, I may be biased because I have done a lot of parsing and other compiler-ish work, but parsing text is really not an uncommon thing to do in a lot of applications.


I have to say that I've gotten code sent to me over Facebook Messenger that looks better-formatted than that thing.


Yeah, pointer arithmetic with raw string handling is usually bad news bears. I wonder if it's possible to write a bot that grabs every "string.c" or "str.c" (etc.) from GitHub and looks for this stuff.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: