Add __null_terminated and its forge macro to cdefs.h, size hash32_buf()
by len and walk the string hashes as NUL-terminated. No change without
the flag.
Sponsored by: The FreeBSD Foundation
Differential D61401
sys: add __null_terminated and bound the hash.h helpers Authored by abhijeetsharma2002_gmail.com on Tue, Nov 10, 6:47 PM.
Details
Diff Detail
Event TimelineComment Actions I'm not sure tagging every string in the kernel with __null_terminated is viable. Can you explain this a little more?
Comment Actions Most strings need no tag. Under -fbounds-safety, const char * is already NUL-terminated, so string parameters and literals work unchanged. The macro is for strings passed as another type; here, that is only the hash32_str*() helpers that take const void *. Passing a char array as a string does need an explicit conversion. Without the flag, nothing changes.
| ||||||||||||||||||||||||||