Hacker News new | ask | show | jobs
by unix-junkie 4790 days ago
I don't get it, it seems to me that this fix is incorrect.

It's pointless to check for such a signed integer overflow after it happened.

2 comments

I think you're right, unless nginx uses --fwrapv or it's equivalent on every compiler.
Why is length stored with a signed integer in the first place?
It's (mis)using off_t, which allows for negative offsets (for obvious reasons). You also don't need signed integers to have integer overflows.