@@ -539,17 +539,6 @@ INTERCEPTOR(char *, strcpy, char *to, const char *from) {
539
539
return REAL (strcpy )(to, from);
540
540
}
541
541
542
- // Windows doesn't always define the strdup identifier,
543
- // and when it does it's a macro defined to either _strdup
544
- // or _strdup_dbg, _strdup_dbg ends up calling _strdup, so
545
- // we want to intercept that. push/pop_macro are used to avoid problems
546
- // if this file ends up including <string.h> in the future.
547
- # if SANITIZER_WINDOWS
548
- # pragma push_macro("strdup")
549
- # undef strdup
550
- # define strdup _strdup
551
- # endif
552
-
553
542
INTERCEPTOR (char *, strdup, const char *s) {
554
543
void *ctx;
555
544
ASAN_INTERCEPTOR_ENTER (ctx, strdup );
@@ -567,7 +556,7 @@ INTERCEPTOR(char*, strdup, const char *s) {
567
556
return reinterpret_cast <char *>(new_mem);
568
557
}
569
558
570
- # if ASAN_INTERCEPT___STRDUP
559
+ #if ASAN_INTERCEPT___STRDUP
571
560
INTERCEPTOR (char *, __strdup, const char *s) {
572
561
void *ctx;
573
562
ASAN_INTERCEPTOR_ENTER (ctx, strdup );
@@ -753,7 +742,7 @@ void InitializeAsanInterceptors() {
753
742
ASAN_INTERCEPT_FUNC (strncat );
754
743
ASAN_INTERCEPT_FUNC (strncpy );
755
744
ASAN_INTERCEPT_FUNC (strdup );
756
- # if ASAN_INTERCEPT___STRDUP
745
+ #if ASAN_INTERCEPT___STRDUP
757
746
ASAN_INTERCEPT_FUNC (__strdup);
758
747
#endif
759
748
#if ASAN_INTERCEPT_INDEX && ASAN_USE_ALIAS_ATTRIBUTE_FOR_INDEX
@@ -842,10 +831,6 @@ void InitializeAsanInterceptors() {
842
831
VReport (1 , " AddressSanitizer: libc interceptors initialized\n " );
843
832
}
844
833
845
- # if SANITIZER_WINDOWS
846
- # pragma pop_macro("strdup")
847
- # endif
848
-
849
834
} // namespace __asan
850
835
851
836
#endif // !SANITIZER_FUCHSIA
0 commit comments