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

Funny how the first example contains a subtle bug, the string termination is never done, if the stack wasn't zeroed prior to running that program, you may not only overflow 'buffer' on purpose, you may overflow it a lot further than you'd think by just reading the code.

large_string[255] = 0;

Would solve that.



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

Search: