logoalt Hacker News

Joker_vD • last Sunday at 10:06 PM • 2 replies • view on HN

Have you seen the wave of recent Whatever2Shell CVEs? Several of them happened precisely because "a type that could only represent positive integers" was used for the sizes.


Replies

steve1977 • today at 9:46 AM

I think it's because of the overflow behavior of the types/operators used, not so much the fact that they only represent positive integers.

grg0 • last Sunday at 10:17 PM

I don't think that's what he's talking about. The problem with those CVEs is an unsigned type with default wrap semantics. But it need not be like that. Look at how Ada allows user-defined integers.

➕ show 1 reply