r268694 - in /branches/gcc-8-branch/libstdc++-v...
redi@gcc.gnu.org
redi@gcc.gnu.org
Fri Feb 8 14:16:00 GMT 2019
Author: redi
Date: Fri Feb 8 14:16:28 2019
New Revision: 268694
URL: https://gcc.gnu.org/viewcvs?rev=268694&root=gcc&view=rev
Log:
PR libstdc++/87787 avoid undefined null args to memcpy and memmove
The C++ char_traits and ctype APIs do not disallow null pointer
arguments, so we need explicit checks to ensure we don't forward null
pointers to memcpy or memmove.
Backport from mainline
2019-01-07 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/87787
* include/bits/char_traits.h (char_traits::move): Do not pass null
pointers to memmove.
* include/bits/locale_facets.h
(ctype<char>::widen(const char*, const char*, char*)): Do not
pass null pointers to memcpy.
(ctype<char>::narrow(const char*, const char*, char, char*)):
Likewise.
(ctype<char>::do_widen(const char*, const char*, char*)):
Likewise.
(ctype<char>::do_narrow(const char*, const char*, char, char*)):
Likewise.
Modified:
branches/gcc-8-branch/libstdc++-v3/ChangeLog
branches/gcc-8-branch/libstdc++-v3/include/bits/char_traits.h
branches/gcc-8-branch/libstdc++-v3/include/bits/locale_facets.h
More information about the Libstdc++-cvs
mailing list