This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/89446] [7/8 Regression] __builtin_constant_p expression crashes in char_traits::compare


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89446

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Author: redi
Date: Sat Feb 23 01:01:56 2019
New Revision: 269143

URL: https://gcc.gnu.org/viewcvs?rev=269143&root=gcc&view=rev
Log:
PR libstdc++/89446 fix null pointer dereference in char_traits

        PR libstdc++/89446
        * include/bits/char_traits.h (__constant_char_array): Check index is
        in range before dereferencing.
        * testsuite/21_strings/basic_string_view/operators/char/89446.cc:
        New test.

Added:
   
branches/gcc-7-branch/libstdc++-v3/testsuite/21_strings/basic_string_view/operators/char/89446.cc
Modified:
    branches/gcc-7-branch/libstdc++-v3/ChangeLog
    branches/gcc-7-branch/libstdc++-v3/include/bits/char_traits.h

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]