/memcheck/tests/vcpu_fnfns
/memcheck/tests/vgtest_ume
/memcheck/tests/wcs
+/memcheck/tests/wcscat
/memcheck/tests/weirdioctl
/memcheck/tests/with space
/memcheck/tests/wcpncpy
501365 syscall userfaultfd not wrapped
501846 Add x86 Linux shm wrappers
501850 FreeBSD syscall arguments 7 and 8 incorrect.
+501893 Missing suppression for __wcscat_avx2 (strcat-strlen-avx2.h.S:68)?
To see details of a given bug, visit
https://bugs.kde.org/show_bug.cgi?id=XXXXXX
vcpu_fnfns.stderr.exp vcpu_fnfns.vgtest \
wcpncpy.stderr.exp wcpncpy.vgtest \
wcs.vgtest wcs.stderr.exp wcs.stdout.exp \
+ wcscat.vgtest wcscat.stderr.exp wcscat.stdout.exp \
wcsncpy.vgtest wcsncpy.stderr.exp \
wmemcmp.vgtest wmemcmp.stderr.exp \
wrap1.vgtest wrap1.stdout.exp wrap1.stderr.exp \
varinforestrict \
vcpu_fbench vcpu_fnfns \
wcs \
+ wcscat \
xml1 \
wmemcmp \
wrap1 wrap2 wrap3 wrap4 wrap5 wrap6 wrap7 wrap7so.so wrap8 \
Conditional jump or move depends on uninitialised value(s)
- at 0x........: wcpncpy (vg_replace_strmem.c:2426)
+ at 0x........: wcpncpy (vg_replace_strmem.c:2427)
by 0x........: main (wcpncpy.c:14)
Invalid write of size 4
- at 0x........: wcpncpy (vg_replace_strmem.c:2426)
+ at 0x........: wcpncpy (vg_replace_strmem.c:2427)
by 0x........: main (wcpncpy.c:27)
Address 0x........ is 20 bytes inside a block of size 22 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (wcpncpy.c:10)
Source and destination overlap in wcpncpy(0x........, 0x........)
- at 0x........: wcpncpy (vg_replace_strmem.c:2426)
+ at 0x........: wcpncpy (vg_replace_strmem.c:2427)
by 0x........: main (wcpncpy.c:35)
Source and destination overlap in wcpncpy(0x........, 0x........)
- at 0x........: wcpncpy (vg_replace_strmem.c:2426)
+ at 0x........: wcpncpy (vg_replace_strmem.c:2427)
by 0x........: main (wcpncpy.c:43)
--- /dev/null
+// See https://bugs.kde.org/show_bug.cgi?id=501893
+#include <wchar.h>
+#include <stdio.h>
+#include <locale.h>
+#include <stdlib.h>
+
+int main(void)
+{
+ wchar_t* str = malloc(sizeof(L"/usr/lib/python310.zip:/usr/lib/python3.10:"));
+ wchar_t* add1 = wcsdup(L"/usr/lib/python310.zip:/usr/lib/python3.10");
+ wchar_t* add2 = wcsdup(L":");
+ str[0] = 0;
+ wcscat(str, add1);
+ wcscat(str, add2);
+ setlocale(LC_ALL, "en_US.utf8");
+ printf("%ls\n", str);
+ free(str);
+ free(add1);
+ free(add2);
+}
--- /dev/null
+/usr/lib/python310.zip:/usr/lib/python3.10:
--- /dev/null
+prog: wcscat
+vgopts: -q
20480 WCSNCPY
20490 MEMCCPY
20500 WCPNCPY
+ 20510 WCSCAT
*/
#if defined(VGO_solaris)
WCPNCPY(VG_Z_LIBC_SONAME, wcpncpy)
#endif
+/*----------------------- wcscat ----------------------*/
+
+#define WCSCAT(soname, fnname) \
+ Int* VG_REPLACE_FUNCTION_EZU(20510,soname,fnname) \
+ ( Int *restrict dest, const Int *restrict src ); \
+ Int* VG_REPLACE_FUNCTION_EZU(20510,soname,fnname) \
+ ( Int *restrict dest, const Int *restrict src ) \
+ { \
+ const Int* src_orig = src; \
+ Int* dest_orig = dest; \
+ while (*dest) dest++; \
+ while (*src) *dest++ = *src++; \
+ *dest = 0; \
+ \
+ /* This is a bit redundant, I think; any overlap and the wcscat will */ \
+ /* go forever... or until a seg fault occurs. */ \
+ if (is_overlap(dest_orig, \
+ src_orig, \
+ (Addr)dest-(Addr)dest_orig+1, \
+ (Addr)src-(Addr)src_orig+1)) \
+ RECORD_OVERLAP_ERROR("wcscat", dest_orig, src_orig, 0); \
+ \
+ return dest_orig; \
+ }
+
+#if defined(VGO_linux)
+ WCSCAT(VG_Z_LIBC_SONAME, __wcscat_avx2)
+#endif
/*------------------------------------------------------------*/
/*--- Improve definedness checking of process environment ---*/