[llvm-bugs] [Bug 35285] New: Address Sanitizer cannot catch using dangling pointer

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Nov 13 01:37:24 PST 2017


https://bugs.llvm.org/show_bug.cgi?id=35285

            Bug ID: 35285
           Summary: Address Sanitizer cannot catch using dangling pointer
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: vladon at yandex-team.ru
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org

===
        #include <string>
        #include <string_view>
        #include <iostream>

        std::string foo() {
            return "test";
        }

        int main() {
            std::string_view bar = foo(); // <-- here bar is pointed to already
destructed string
            std::cout << bar << std::endl;
        }
===

Address sanitizer cannot catch this bug.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20171113/90bdd0ae/attachment.html>


More information about the llvm-bugs mailing list