logoalt Hacker News

WalterBright • today at 6:18 PM • 4 replies • view on HN

> Calling EVP_EncodeBlock() with an input length close to INT_MAX may overflow the calculation of the encoded output size and write past the end of the caller-supplied output buffer.

Haven't we suffered enough yet with lack of a basic feature in C? Why are enhancements going into C that never address this fundamental problem?

I wrote this proposal for C 17 years ago:

file:///C:/digitalmars/articles/C-biggest-mistake.html

It's a simple addition, it breaks 0 code, and provides a path forward to stop array overflows for good.

It's a foundational feature for D. We don't have buffer overflows.


Replies

diath • today at 6:34 PM

> We don't have buffer overflows.

You don't have that class of buffer overflows, but for as long as D allows raw pointer arithmetic, you still got buffer overflows, i.e. here's a simple snippet triggering ASAN: https://godbolt.org/z/qPhMKzM1z

Matheus28 • today at 6:35 PM

Might wanna double check that url

Sohcahtoa82 • today at 8:03 PM

> file:///C:/digitalmars/articles/C-biggest-mistake.html

Is that URL supposed to be a joke?