This repository has been archived by the owner on Jan 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dfsan] Make sprintf interceptor compatible with glibc 2.37+ and musl…
… (#78363) snprintf interceptors call `format_buffer` with `size==~0ul`, which may eventually lead to `snprintf(s, n, "Hello world!")` where `s+n` wraps around. Since glibc 2.37 (https://sourceware.org/PR30441), the snprintf call does not write the last char. musl snprintf returns -1 with EOVERFLOW when `n > INT_MAX`. Change `size` to INT_MAX to work with glibc 2.37+ and musl. snprintf interceptors are not changed. It's user responsibility to not cause a compatibility issue with libc implementations. Fix #60678
- Loading branch information
Showing
3 changed files
with
3 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters