diff options
| author | jvoisin | 2023-09-29 14:50:24 +0200 |
|---|---|---|
| committer | jvoisin | 2023-09-29 14:50:24 +0200 |
| commit | 4988174f7eecc6da544ebf23156ce638cecf0f3f (patch) | |
| tree | 181757bfa8c9d78d32bf19f997370933589df23c | |
| parent | 3067c28ceb744b2bafe9202023084f762871e844 (diff) | |
Make use of the native _chk variants for real
| -rw-r--r-- | .github/workflows/testsuite.yaml | 4 | ||||
| -rw-r--r-- | include/stdio.h | 4 | ||||
| -rw-r--r-- | tests/Makefile | 2 |
3 files changed, 3 insertions, 7 deletions
diff --git a/.github/workflows/testsuite.yaml b/.github/workflows/testsuite.yaml index 73af29f..0f1f9b3 100644 --- a/.github/workflows/testsuite.yaml +++ b/.github/workflows/testsuite.yaml | |||
| @@ -31,10 +31,6 @@ jobs: | |||
| 31 | run: | | 31 | run: | |
| 32 | sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-${{ matrix.version }} 100 | 32 | sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-${{ matrix.version }} 100 |
| 33 | sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ matrix.version }} 100 | 33 | sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ matrix.version }} 100 |
| 34 | - name: Build with native chk | ||
| 35 | if: ${{ matrix.use_native_chk == true }} | ||
| 36 | shell: bash | ||
| 37 | run: make CFLAGS=-DUSE_NATIVE_CHK -C tests gcc | ||
| 38 | - name: Build without native chk, and run the testsuite | 34 | - name: Build without native chk, and run the testsuite |
| 39 | if: ${{ matrix.use_native_chk == false }} | 35 | if: ${{ matrix.use_native_chk == false }} |
| 40 | shell: bash | 36 | shell: bash |
diff --git a/include/stdio.h b/include/stdio.h index c363edc..e93fe19 100644 --- a/include/stdio.h +++ b/include/stdio.h | |||
| @@ -147,7 +147,7 @@ _FORTIFY_FN(vsnprintf) int vsnprintf(char * _FORTIFY_POS0 __s, size_t __n, | |||
| 147 | const char *__f, __builtin_va_list __v) | 147 | const char *__f, __builtin_va_list __v) |
| 148 | { | 148 | { |
| 149 | #if __has_builtin(__builtin___vsnprintf_chk) && USE_NATIVE_CHK | 149 | #if __has_builtin(__builtin___vsnprintf_chk) && USE_NATIVE_CHK |
| 150 | return __builtin___vsnprintf_chk(__s, __n, _FORTIFY_SOURCE, __bos(__s, 0), __f, __v,); | 150 | return __builtin___vsnprintf_chk(__s, __n, _FORTIFY_SOURCE, __bos(__s, 0), __f, __v); |
| 151 | #else | 151 | #else |
| 152 | size_t __b = __bos(__s, 0); | 152 | size_t __b = __bos(__s, 0); |
| 153 | 153 | ||
| @@ -167,7 +167,7 @@ _FORTIFY_FN(vsprintf) int vsprintf(char * _FORTIFY_POS0 __s, const char *__f, | |||
| 167 | __builtin_va_list __v) | 167 | __builtin_va_list __v) |
| 168 | { | 168 | { |
| 169 | #if __has_builtin(__builtin___vsprintf_chk) && USE_NATIVE_CHK | 169 | #if __has_builtin(__builtin___vsprintf_chk) && USE_NATIVE_CHK |
| 170 | return __builtin___vsprintf_chk(__s, _FORTIFY_SOURCE, __bos(__s, 0), __f, __v,); | 170 | return __builtin___vsprintf_chk(__s, _FORTIFY_SOURCE, __bos(__s, 0), __f, __v); |
| 171 | #else | 171 | #else |
| 172 | size_t __b = __bos(__s, 0); | 172 | size_t __b = __bos(__s, 0); |
| 173 | int __r; | 173 | int __r; |
diff --git a/tests/Makefile b/tests/Makefile index a628a2a..81593cf 100644 --- a/tests/Makefile +++ b/tests/Makefile | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | CFLAGS=-I../include/ -D_FORTIFY_SOURCE=3 -static -O2 | 1 | CFLAGS+=-I../include/ -D_FORTIFY_SOURCE=3 -static -O2 |
| 2 | 2 | ||
| 3 | COMPTIME_TARGETS= \ | 3 | COMPTIME_TARGETS= \ |
| 4 | test_memcpy_overwrite_under \ | 4 | test_memcpy_overwrite_under \ |
