Page MenuHomeFreeBSD

include: ssp: fortify <wchar.h>
ClosedPublic

Authored by kevans on Jun 21 2024, 4:59 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Dec 25, 11:14 AM
Unknown Object (File)
Tue, Dec 24, 8:40 AM
Unknown Object (File)
Sun, Dec 22, 5:51 PM
Unknown Object (File)
Sun, Dec 15, 9:49 PM
Unknown Object (File)
Nov 24 2024, 11:11 PM
Unknown Object (File)
Nov 22 2024, 8:57 AM
Unknown Object (File)
Nov 22 2024, 8:57 AM
Unknown Object (File)
Nov 22 2024, 8:44 AM
Subscribers

Details

Summary

This includes all of the w*() equivalents to str*()/mem*() implemented
in more or less the same way. For these ones, we'll just use
header-only implementations from the start to stop further cluttering
the libc symbol table.

Sponsored by: Stormshield
Sponsored by: Klara, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

include/ssp/wchar.h
51

Do you need __BEGIN_DECLS for these inline functions?

59

Do you need to multiply len by sizeof(wchar_t) here? I think __ssp_overlap takes a bytecount.

include/ssp/wchar.h
59

Oh, I guess that's ok, it uses pointer arithmetic. That's a bit subtle.

kevans added inline comments.
include/ssp/wchar.h
51

Not for the inlines, but __ssp_redirect_raw_impl also adds a couple of declarations with the symbol renaming bits before the function signature

59

Based on these and some other discussion, see D45940 for another take. I'll likely reorder that one to before this and just make these use the __ssp_wchar_overlap() helper from the start if that seems reasonable.

This revision is now accepted and ready to land.Jul 11 2024, 7:06 PM
This revision was automatically updated to reflect the committed changes.
kevans marked an inline comment as done.