]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix wcscpy wrapper.
authorNicholas Nethercote <nnethercote@mozilla.com>
Wed, 2 Dec 2020 05:18:06 +0000 (16:18 +1100)
committerNicholas Nethercote <nnethercote@mozilla.com>
Wed, 2 Dec 2020 05:18:06 +0000 (16:18 +1100)
wcscpy deals with wchar_t, which has a size of 4, so the adjustment in
the wrapper must be +4 instead of +1.

shared/vg_replace_strmem.c

index 87a4bcc5506a200d35a46018338f69f7e249351d..df61aa1327a2050c8e241831db9ac5e0f476af3b 100644 (file)
@@ -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; \