Skip to content

Commit 782669a

Browse files
committed
fixup! [compiler-rt][asan] Add wcscpy/wcsncpy; enable wcscat/wcsncat on Windows
Signed-off-by: Yixuan Cao <[email protected]>
1 parent 205ece1 commit 782669a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

compiler-rt/lib/asan/asan_interceptors.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -583,10 +583,10 @@ INTERCEPTOR(wchar_t *, wcscpy, wchar_t *to, const wchar_t *from) {
583583
if (!TryAsanInitFromRtl())
584584
return REAL(wcscpy)(to, from);
585585
if (flags()->replace_str) {
586-
uptr from_size = (internal_wcslen(from) + 1) * sizeof(wchar_t);
587-
CHECK_RANGES_OVERLAP("wcscpy", to, from_size, from, from_size);
588-
ASAN_READ_RANGE(ctx, from, from_size);
589-
ASAN_WRITE_RANGE(ctx, to, from_size);
586+
uptr size = (internal_wcslen(from) + 1) * sizeof(wchar_t);
587+
CHECK_RANGES_OVERLAP("wcscpy", to, size, from, size);
588+
ASAN_READ_RANGE(ctx, from, size);
589+
ASAN_WRITE_RANGE(ctx, to, size);
590590
}
591591
return REAL(wcscpy)(to, from);
592592
}

0 commit comments

Comments
 (0)