diff options
author | Andreas Schwab <schwab@suse.de> | 2024-08-05 10:55:51 +0200 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2024-08-06 09:04:53 +0200 |
commit | 9f86cde5d4dd4448e949d8fe40846663d5378c59 (patch) | |
tree | 77612d5f06acd932ca2797a433a97611df52d778 /libio | |
parent | dbc0e02dbb20a8c13f56ae8f31a03a8f130f8b9c (diff) | |
download | glibc-9f86cde5d4dd4448e949d8fe40846663d5378c59.tar.gz glibc-9f86cde5d4dd4448e949d8fe40846663d5378c59.tar.xz glibc-9f86cde5d4dd4448e949d8fe40846663d5378c59.zip |
Fix name space violation in fortify wrappers (bug 32052)
Rename the identifier sz to __sz everywhere. Fixes: a643f60c53 ("Make sure that the fortified function conditionals are constant") (cherry picked from commit 39ca997ab378990d5ac1aadbaa52aaf1db6d526f) (redone from scratch because of many conflicts)
Diffstat (limited to 'libio')
-rw-r--r-- | libio/bits/stdio2.h | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/libio/bits/stdio2.h b/libio/bits/stdio2.h index 4570f86a44..5d1f3574f9 100644 --- a/libio/bits/stdio2.h +++ b/libio/bits/stdio2.h @@ -208,12 +208,12 @@ extern char *__REDIRECT (__fgets_chk_warn, __fortify_function __wur __fortified_attr_access (__write_only__, 1, 2) char * fgets (char *__restrict __s, int __n, FILE *__restrict __stream) { - size_t sz = __glibc_objsize (__s); - if (__glibc_safe_or_unknown_len (__n, sizeof (char), sz)) + size_t __sz = __glibc_objsize (__s); + if (__glibc_safe_or_unknown_len (__n, sizeof (char), __sz)) return __fgets_alias (__s, __n, __stream); - if (__glibc_unsafe_len (__n, sizeof (char), sz)) - return __fgets_chk_warn (__s, sz, __n, __stream); - return __fgets_chk (__s, sz, __n, __stream); + if (__glibc_unsafe_len (__n, sizeof (char), __sz)) + return __fgets_chk_warn (__s, __sz, __n, __stream); + return __fgets_chk (__s, __sz, __n, __stream); } extern size_t __REDIRECT (__fread_alias, @@ -232,12 +232,12 @@ __fortify_function __wur size_t fread (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) { - size_t sz = __glibc_objsize0 (__ptr); - if (__glibc_safe_or_unknown_len (__n, __size, sz)) + size_t __sz = __glibc_objsize0 (__ptr); + if (__glibc_safe_or_unknown_len (__n, __size, __sz)) return __fread_alias (__ptr, __size, __n, __stream); - if (__glibc_unsafe_len (__n, __size, sz)) - return __fread_chk_warn (__ptr, sz, __size, __n, __stream); - return __fread_chk (__ptr, sz, __size, __n, __stream); + if (__glibc_unsafe_len (__n, __size, __sz)) + return __fread_chk_warn (__ptr, __sz, __size, __n, __stream); + return __fread_chk (__ptr, __sz, __size, __n, __stream); } #ifdef __USE_GNU @@ -254,12 +254,12 @@ extern char *__REDIRECT (__fgets_unlocked_chk_warn, __fortify_function __wur __fortified_attr_access (__write_only__, 1, 2) char * fgets_unlocked (char *__restrict __s, int __n, FILE *__restrict __stream) { - size_t sz = __glibc_objsize (__s); - if (__glibc_safe_or_unknown_len (__n, sizeof (char), sz)) + size_t __sz = __glibc_objsize (__s); + if (__glibc_safe_or_unknown_len (__n, sizeof (char), __sz)) return __fgets_unlocked_alias (__s, __n, __stream); - if (__glibc_unsafe_len (__n, sizeof (char), sz)) - return __fgets_unlocked_chk_warn (__s, sz, __n, __stream); - return __fgets_unlocked_chk (__s, sz, __n, __stream); + if (__glibc_unsafe_len (__n, sizeof (char), __sz)) + return __fgets_unlocked_chk_warn (__s, __sz, __n, __stream); + return __fgets_unlocked_chk (__s, __sz, __n, __stream); } #endif @@ -281,8 +281,8 @@ __fortify_function __wur size_t fread_unlocked (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) { - size_t sz = __glibc_objsize0 (__ptr); - if (__glibc_safe_or_unknown_len (__n, __size, sz)) + size_t __sz = __glibc_objsize0 (__ptr); + if (__glibc_safe_or_unknown_len (__n, __size, __sz)) { # ifdef __USE_EXTERN_INLINES if (__builtin_constant_p (__size) @@ -307,9 +307,9 @@ fread_unlocked (void *__restrict __ptr, size_t __size, size_t __n, # endif return __fread_unlocked_alias (__ptr, __size, __n, __stream); } - if (__glibc_unsafe_len (__n, __size, sz)) - return __fread_unlocked_chk_warn (__ptr, sz, __size, __n, __stream); - return __fread_unlocked_chk (__ptr, sz, __size, __n, __stream); + if (__glibc_unsafe_len (__n, __size, __sz)) + return __fread_unlocked_chk_warn (__ptr, __sz, __size, __n, __stream); + return __fread_unlocked_chk (__ptr, __sz, __size, __n, __stream); } #endif |