Y
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
bcoates
4790 days ago
I think you're right, unless nginx uses --fwrapv or it's equivalent on every compiler.
link
lysium
4790 days ago
Why is length stored with a signed integer in the first place?
link
tptacek
4790 days ago
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.
link