diff options
author | Nick Kralevich <nnk@google.com> | 2012-12-07 09:57:01 -0800 |
---|---|---|
committer | Nick Kralevich <nnk@google.com> | 2012-12-07 09:57:01 -0800 |
commit | 57874753900865312d7d265d2ca15cb4edb00ef2 (patch) | |
tree | 344ba9328ef618db3dec557b592ec5f1f64e272e /libc/include/string.h | |
parent | 5dfdb701292c53e74e319f277d808e598389c8e7 (diff) | |
download | bionic-57874753900865312d7d265d2ca15cb4edb00ef2.zip bionic-57874753900865312d7d265d2ca15cb4edb00ef2.tar.gz bionic-57874753900865312d7d265d2ca15cb4edb00ef2.tar.bz2 |
FORTIFY_SOURCE: remove memcpy overlap checks
These checks haven't been as useful as I hoped, and it's
causing a false positive finding. Remove the overlap
compile time checks.
Change-Id: I5d45dde10ae4663d728230d41fa904adf20acaea
Diffstat (limited to 'libc/include/string.h')
-rw-r--r-- | libc/include/string.h | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/libc/include/string.h b/libc/include/string.h index 2ed74e8..6643d28 100644 --- a/libc/include/string.h +++ b/libc/include/string.h @@ -91,8 +91,6 @@ extern void __memcpy_dest_size_error() __attribute__((__error__("memcpy called with size bigger than destination"))); extern void __memcpy_src_size_error() __attribute__((__error__("memcpy called with size bigger than source"))); -extern void __memcpy_overlap_error() - __attribute__((__error__("memcpy called with overlapping regions"))); __BIONIC_FORTIFY_INLINE void *memcpy (void *dest, const void *src, size_t copy_amount) { @@ -109,11 +107,6 @@ void *memcpy (void *dest, const void *src, size_t copy_amount) { __memcpy_src_size_error(); } - if (__builtin_constant_p(d - s) && __builtin_constant_p(copy_amount) - && (((size_t)(d - s) < copy_amount) || ((size_t)(s - d) < copy_amount))) { - __memcpy_overlap_error(); - } - return __builtin___memcpy_chk(dest, src, copy_amount, d_len); } |