3 ms·
AFAIK my own memset_s is the only secure one: https://github.com/rurban/safeclib/tree/master/src/mem https://github.com/rurban/safeclib/tree/master/src/mem but
by rurban 8y ago
AFAIK my own memset_s is the only secure one:
https://github.com/rurban/safeclib/tree/master/src/mem https://github.com/rurban/safeclib/tree/master/src/mem
but nobody cares. It was not mentioned at this years CCC talk about memset. Everybody thinks a simple compiler barrier is enough, it is not.
The strncpy truncating problem is widely known: https://www.google.com/search?q=strncpy+truncating+problem https://www.google.com/search?q=strncpy+truncating+problem
But conceptually the biggest problem is the inability to deal with strings properly at all. You mentioned the iswalpha problem and the need for external libs, but the standard cannot even search for unicode strings properly (no normalization wcsnorm, no wcsfc, no UTF-8 u8 API), ditto sorting needs an API for the unicode version being used. It's relative and changes every year. And every libc is hopelessly behind. The most basic coreutils still cannot search for foreign strings (grep, sort, wc, cut, expand, ...):
http://perl11.org/blog/foldcase.html http://perl11.org/blog/foldcase.html
https://crashcourse.housegordon.org/coreutils-multibyte-support.html https://crashcourse.housegordon.org/coreutils-multibyte-supp...