[all-commits] [llvm/llvm-project] 685c94: SIGSEGV in Sanitizer INTERCEPTOR of strstr function.

RitanyaB via All-commits all-commits at lists.llvm.org
Wed Jan 5 00:12:11 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 685c94c6cbba4f2bf076b01fd3e0dcb4b1425b53
      https://github.com/llvm/llvm-project/commit/685c94c6cbba4f2bf076b01fd3e0dcb4b1425b53
  Author: Bharadwaj, Ritanya B <ritanya-b.bharadwaj at hpe.com>
  Date:   2022-01-05 (Wed, 05 Jan 2022)

  Changed paths:
    M compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
    M compiler-rt/lib/sanitizer_common/sanitizer_libc.cpp
    M compiler-rt/test/sanitizer_common/TestCases/strstr.c

  Log Message:
  -----------
  SIGSEGV in Sanitizer INTERCEPTOR of strstr function.

This is a segmentation fault in INTERCEPTOR function on a special edge
case of strstr libc call. When 'Haystack'(main string to be examined) is
NULL and 'needle'(sub-string to be searched in 'Haystack') is an empty
string then it hits a SEGV while using sanitizers and as a 'string not
found' case otherwise.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D115919




More information about the All-commits mailing list