diff options
author | Ilya Enkovich <ilya.enkovich@intel.com> | 2015-04-09 10:11:30 +0000 |
---|---|---|
committer | Ilya Enkovich <ienkovich@gcc.gnu.org> | 2015-04-09 10:11:30 +0000 |
commit | 3ba99d8a035e95aa93eb2fc56739f63c36582213 (patch) | |
tree | 197c099455b92c4fccdc2a89f6f4d5cbb0d7ae2d /libmpx | |
parent | 54414978ae4085ffce4bb00d802e29e35ed6d6b3 (diff) | |
download | gcc-3ba99d8a035e95aa93eb2fc56739f63c36582213.zip gcc-3ba99d8a035e95aa93eb2fc56739f63c36582213.tar.gz gcc-3ba99d8a035e95aa93eb2fc56739f63c36582213.tar.bz2 |
mpx_wrappers.c (__mpx_wrapper_memmove): Add zero length check.
libmpx/
* mpxwrap/mpx_wrappers.c (__mpx_wrapper_memmove): Add
zero length check.
gcc/testsuite/
* gcc.target/i386/mpx/memmove-zero-length.c: New.
From-SVN: r221944
Diffstat (limited to 'libmpx')
-rw-r--r-- | libmpx/ChangeLog | 5 | ||||
-rw-r--r-- | libmpx/mpxwrap/mpx_wrappers.c | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/libmpx/ChangeLog b/libmpx/ChangeLog index 6b05278..56c3c5f 100644 --- a/libmpx/ChangeLog +++ b/libmpx/ChangeLog @@ -1,3 +1,8 @@ +2015-04-09 Ilya Enkovich <ilya.enkovich@intel.com> + + * mpxwrap/mpx_wrappers.c (__mpx_wrapper_memmove): Add + zero length check. + 2015-04-02 Ilya Enkovich <ilya.enkovich@intel.com> PR driver/65444 diff --git a/libmpx/mpxwrap/mpx_wrappers.c b/libmpx/mpxwrap/mpx_wrappers.c index ef4be8d..58670aa 100644 --- a/libmpx/mpxwrap/mpx_wrappers.c +++ b/libmpx/mpxwrap/mpx_wrappers.c @@ -97,6 +97,9 @@ __mpx_wrapper_memmove (void *dst, const void *src, size_t n) size_t offset_src = ((size_t) s) & (sizeof (void *) - 1); size_t offset_dst = ((size_t) d) & (sizeof (void *) - 1); + if (n == 0) + return ret; + __bnd_chk_ptr_bounds (dst, n); __bnd_chk_ptr_bounds (src, n); |