News for hackers. Stuff that matters.
Re:Is All Programming a Scam? by al2o3cr on Monday July 10, 2023 @09:44PM (#36675499)
My C is rusty, but what happens if "handle_request" gets a request that's BUFFER_SIZE+1 "A"s?

Seems to me like "read" will read exactly BUFFER_SIZE "A"s and no null-terminator, causing the subsequent "strsep" to find the first \n... someplace in memory (after the buffer) and overwrite it with a null-terminator.

Re:Is All Programming a Scam? by mkristiansen on Tuesday July 11, 2023 @04:34PM (#36686873)
Thank you, you are right - and I appreciate the rusty pun. I think, as a general thing, there are a few things that I would do differently if I wanted to build a production version of this code. Firstly I would find a better way of parsing the headers. :)