|
From: Nicholas N. <nj...@so...> - 2020-12-02 05:21:14
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=95470d249b93d7eac7b936b81a4ceb224986fd06 commit 95470d249b93d7eac7b936b81a4ceb224986fd06 Author: Nicholas Nethercote <nne...@mo...> Date: Wed Dec 2 16:18:06 2020 +1100 Fix wcscpy wrapper. wcscpy deals with wchar_t, which has a size of 4, so the adjustment in the wrapper must be +4 instead of +1. Diff: --- shared/vg_replace_strmem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared/vg_replace_strmem.c b/shared/vg_replace_strmem.c index 87a4bcc550..df61aa1327 100644 --- a/shared/vg_replace_strmem.c +++ b/shared/vg_replace_strmem.c @@ -1979,8 +1979,8 @@ static inline void my_exit ( int x ) /* pre-counting length... should be ok */ \ if (is_overlap(dst_orig, \ src_orig, \ - (Addr)dst-(Addr)dst_orig+1, \ - (Addr)src-(Addr)src_orig+1)) \ + (Addr)dst-(Addr)dst_orig+4, \ + (Addr)src-(Addr)src_orig+4)) \ RECORD_OVERLAP_ERROR("wcscpy", dst_orig, src_orig, 0); \ \ return dst_orig; \ |