From: Nicholas Nethercote Date: Wed, 2 Dec 2020 05:18:06 +0000 (+1100) Subject: Fix wcscpy wrapper. X-Git-Tag: VALGRIND_3_17_0~104 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=95470d249b93d7eac7b936b81a4ceb224986fd06;p=thirdparty%2Fvalgrind.git 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 --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; \