Sujet : Re: Computer architects leaving Intel...
De : jgd (at) *nospam* cix.co.uk (John Dallman)
Groupes : comp.archDate : 01. Sep 2024, 11:21:39
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <memo.20240901112118.19028G@jgd.cix.co.uk>
References : 1
In article <
2024Aug31.170347@mips.complang.tuwien.ac.at>,
anton@mips.complang.tuwien.ac.at (Anton Ertl) wrote:
Undefined behaviour is something that is exercised at run-time.
That's why the "undefined behaviour sanitizers" insert run-time
checks. And of course they only detect the behaviour when it is
actually exercised. I.e., they usually will not detect overflowable
buffers, because your usual test inputs don't exercise those.
That's among the many reasons why there is no single way "to make code
secure." For string buffers, you turn on the compiler run-time checks,
and use the length-checking versions of string handling functions. Then
you write tests to check both of those are actually working.
Then you discover that the C++ string[] operator is not bounds-checked,
as per the C++ standard, but string.at() is bounds-checked, and curse a
bit.
John