Hacker News new | ask | show | jobs
by Eridrus 3323 days ago
One of the funniest things I've seen in code I saw in PHP core a decade ago; they had a buffer underflow where they would overwrite arr[-1] with some character. Their solution was to save the contents of arr[-1] before the loop, then restore it afterwards.
1 comments

Sweet Jesus. I could almost understand it if they allocated an extra byte and then used an offset base pointer....