Skip to content

Comment on Fixing a Buffer Overflow in Unix v4 Like It's 1973parent

Comments

Isn't sizeof only standardised in C89? Wouldn't shock me if this form needs to be an rvalue.

The author did try pointer arithmetic:

I initially attempted a fix using pointer arithmetic, but the 1973 C compiler didn’t like it, while it didn’t refuse the syntax, the code had no effect.

This surprised me too. The snippet I was quoting from was already using sizeof, though.

I missed the blurb about pointer arithmetic. Would be interesting to go into detail about what "had no effect" means.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.