This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/80893] std::vector<bool> creation dereferences null pointer
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 07 Aug 2018 22:51:20 +0000
- Subject: [Bug libstdc++/80893] std::vector<bool> creation dereferences null pointer
- Auto-submitted: auto-generated
- References: <bug-80893-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80893
--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Author: redi
Date: Tue Aug 7 22:50:45 2018
New Revision: 263381
URL: https://gcc.gnu.org/viewcvs?rev=263381&root=gcc&view=rev
Log:
PR libstdc++/80893 Fix null dereference in vector<bool>
Backport from mainline
2017-06-17 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/80893
* testsuite/23_containers/vector/bool/80893.cc: Add { target c++11 }.
Backport from mainline
2017-05-31 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/80893
* include/bits/stl_bvector.h (vector<bool>::_M_initialize): Avoid
null pointer dereference when size is zero.
* testsuite/23_containers/vector/bool/80893.cc: New.
* testsuite/util/testsuite_allocator.h (PointerBase::PointerBase):
Add non-explicit constructor from nullptr.
(PointerBase::derived() const): Add const-qualified overload.
Added:
branches/gcc-7-branch/libstdc++-v3/testsuite/23_containers/vector/bool/80893.cc
Modified:
branches/gcc-7-branch/libstdc++-v3/ChangeLog
branches/gcc-7-branch/libstdc++-v3/include/bits/stl_bvector.h
branches/gcc-7-branch/libstdc++-v3/testsuite/util/testsuite_allocator.h