Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pppd: Avoid use of strnlen (and strlen) in vslprintf
Commit b311e98 ("pppd: Limit memory accessed by string formats with max length specified") added calls to strnlen() in vslprintf(). Unfortunately, strnlen() is not provided in some standard C libraries. This changes the code to avoid using strnlen(). Using the observation that the number of characters we can use from the input string is bounded by buflen, the number of bytes of output buffer available, we can also avoid doing strlen() on a potentially long string. Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
- Loading branch information