28 ms·
The mentioned Safe C Library is now at https://github.com/rurban/safeclib https://github.com/rurban/safeclib
by rurban 8y ago
The mentioned Safe C Library is now at https://github.com/rurban/safeclib https://github.com/rurban/safeclib
- pjmlp 8y agoThe problem with secure C11 Annex K functions, is that they are only secure in name. They are still as insecure as any traditional C string and memory function. Yes, they sorted out the issues about then a string always gets its null terminator. However given that buffer and size are still two different parameters, the issue of mixing up the values is still present.
- rurban 8y agoNope. The buffer size is checked at compile-time. Much like glibc fortify, just better. There's no chance to mix them up. Even the spec'd unsafeties of the truncating n versions are fixed.
- pjmlp 8y agoCan you please explain how strcpy_s() validates that dest actually points to a memory region with enough space for destsz bytes? https://en.cppreference.com/w/c/string/byte/strcpy https://en.cppreference.com/w/c/string/byte/strcpy