HomeFreeBSD

Add fmtcheck(), a function for checking consistency of format string
rS75578Unpublished

Unpublished Commit ยท Learn More

No further details are available.

Description

Add fmtcheck(), a function for checking consistency of format string
arguments where the format string is obtained from user data, or
otherwise difficult to verify statically.

Example usage:

printf(fmtcheck(user_format, standard_format), arg1, arg2);

checks the format string user_format for consistency (same number/order/
type of format operators) with standard_format. If they differ,
standard_format is used instead to avoid potential crashes or security
violations.

Obtained from: NetBSD
Reviewed by: -arch

Details

Provenance
krisAuthored on
Parents
rS75577: -Wnon-const-format sweep: make format strings const char *'s, add
Branches
Unknown
Tags
Unknown

Event Timeline