about summary refs log tree commit diff
path: root/string/bits/strings_fortified.h
diff options
context:
space:
mode:
authorSiddhesh Poyarekar <siddhesh@sourceware.org>2020-12-30 11:09:58 +0530
committerSiddhesh Poyarekar <siddhesh@sourceware.org>2020-12-31 16:55:21 +0530
commit2a3224c53653214cbba2ec23424702193c80ea3b (patch)
treec34edd8ad17636d2aef26f16dd69ebcff87d1dbe /string/bits/strings_fortified.h
parentc43c5796121bc5bcc0867f02e5536874aa8196c1 (diff)
downloadglibc-2a3224c53653214cbba2ec23424702193c80ea3b.tar.gz
glibc-2a3224c53653214cbba2ec23424702193c80ea3b.tar.xz
glibc-2a3224c53653214cbba2ec23424702193c80ea3b.zip
string: Enable __FORTIFY_LEVEL=3
This change enhances fortified string functions to use
__builtin_dynamic_object_size under _FORTIFY_SOURCE=3 whenever the
compiler supports it.
Diffstat (limited to 'string/bits/strings_fortified.h')
-rw-r--r--string/bits/strings_fortified.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/string/bits/strings_fortified.h b/string/bits/strings_fortified.h
index d4091f4f69..7752faf4e3 100644
--- a/string/bits/strings_fortified.h
+++ b/string/bits/strings_fortified.h
@@ -22,13 +22,15 @@
 __fortify_function void
 __NTH (bcopy (const void *__src, void *__dest, size_t __len))
 {
-  (void) __builtin___memmove_chk (__dest, __src, __len, __bos0 (__dest));
+  (void) __builtin___memmove_chk (__dest, __src, __len,
+				  __glibc_objsize0 (__dest));
 }
 
 __fortify_function void
 __NTH (bzero (void *__dest, size_t __len))
 {
-  (void) __builtin___memset_chk (__dest, '\0', __len, __bos0 (__dest));
+  (void) __builtin___memset_chk (__dest, '\0', __len,
+				 __glibc_objsize0 (__dest));
 }
 
 #endif