@@ -58,20 +58,13 @@ namespace __asan {
58
58
59
59
static inline uptr MaybeRealStrnlen (const char *s, uptr maxlen) {
60
60
#if SANITIZER_INTERCEPT_STRNLEN
61
- if (REAL (strnlen))
61
+ if (REAL (strnlen)) {
62
62
return REAL (strnlen)(s, maxlen);
63
- # endif
63
+ }
64
+ #endif
64
65
return internal_strnlen (s, maxlen);
65
66
}
66
67
67
- static inline uptr MaybeRealWcsnlen (const wchar_t * s, uptr maxlen) {
68
- # if SANITIZER_INTERCEPT_WCSNLEN
69
- if (REAL (wcsnlen))
70
- return REAL (wcsnlen)(s, maxlen);
71
- # endif
72
- return internal_wcsnlen (s, maxlen);
73
- }
74
-
75
68
void SetThreadName (const char *name) {
76
69
AsanThread *t = GetCurrentThread ();
77
70
if (t)
@@ -577,20 +570,6 @@ INTERCEPTOR(char *, strcpy, char *to, const char *from) {
577
570
return REAL (strcpy)(to, from);
578
571
}
579
572
580
- INTERCEPTOR (wchar_t *, wcscpy, wchar_t * to, const wchar_t * from) {
581
- void * ctx;
582
- ASAN_INTERCEPTOR_ENTER (ctx, wcscpy);
583
- if (!TryAsanInitFromRtl ())
584
- return REAL (wcscpy)(to, from);
585
- if (flags ()->replace_str ) {
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);
590
- }
591
- return REAL (wcscpy)(to, from);
592
- }
593
-
594
573
// Windows doesn't always define the strdup identifier,
595
574
// and when it does it's a macro defined to either _strdup
596
575
// or _strdup_dbg, _strdup_dbg ends up calling _strdup, so
@@ -654,20 +633,6 @@ INTERCEPTOR(char*, strncpy, char *to, const char *from, usize size) {
654
633
return REAL (strncpy)(to, from, size);
655
634
}
656
635
657
- INTERCEPTOR (wchar_t *, wcsncpy, wchar_t * to, const wchar_t * from, uptr size) {
658
- void * ctx;
659
- ASAN_INTERCEPTOR_ENTER (ctx, wcsncpy);
660
- AsanInitFromRtl ();
661
- if (flags ()->replace_str ) {
662
- uptr from_size =
663
- Min (size, MaybeRealWcsnlen (from, size) + 1 ) * sizeof (wchar_t );
664
- CHECK_RANGES_OVERLAP (" wcsncpy" , to, from_size, from, from_size);
665
- ASAN_READ_RANGE (ctx, from, from_size);
666
- ASAN_WRITE_RANGE (ctx, to, size * sizeof (wchar_t ));
667
- }
668
- return REAL (wcsncpy)(to, from, size);
669
- }
670
-
671
636
template <typename Fn>
672
637
static ALWAYS_INLINE auto StrtolImpl (void *ctx, Fn real, const char *nptr,
673
638
char **endptr, int base)
@@ -844,11 +809,6 @@ void InitializeAsanInterceptors() {
844
809
ASAN_INTERCEPT_FUNC (strncat);
845
810
ASAN_INTERCEPT_FUNC (strncpy);
846
811
ASAN_INTERCEPT_FUNC (strdup);
847
-
848
- // Intercept wcs* functions.
849
- ASAN_INTERCEPT_FUNC (wcscpy);
850
- ASAN_INTERCEPT_FUNC (wcsncpy);
851
-
852
812
# if ASAN_INTERCEPT___STRDUP
853
813
ASAN_INTERCEPT_FUNC (__strdup);
854
814
#endif
0 commit comments