mirror of
https://github.com/boostorg/regex.git
synced 2025-07-29 12:07:28 +02:00
Avoid generating pointers in writeable data section.
They increase memory consumption and make exploits easier and are completely unnecessary. Avoid them by either avoiding the pointer indirection completely by using char arrays for strings instead of char pointers, convert "static" pointer variables to simple local variables, or mark the array of pointers as const instead of just the things pointed to.
This commit is contained in:
committed by
Reimar Döffinger
parent
a550507517
commit
3168641320
@ -354,8 +354,8 @@ icu_regex_traits::char_class_type icu_regex_traits::lookup_icu_mask(const ::UCha
|
||||
};
|
||||
|
||||
|
||||
static const BOOST_REGEX_DETAIL_NS::character_pointer_range< ::UChar32>* ranges_begin = range_data;
|
||||
static const BOOST_REGEX_DETAIL_NS::character_pointer_range< ::UChar32>* ranges_end = range_data + (sizeof(range_data)/sizeof(range_data[0]));
|
||||
const BOOST_REGEX_DETAIL_NS::character_pointer_range< ::UChar32>* ranges_begin = range_data;
|
||||
const BOOST_REGEX_DETAIL_NS::character_pointer_range< ::UChar32>* ranges_end = range_data + (sizeof(range_data)/sizeof(range_data[0]));
|
||||
|
||||
BOOST_REGEX_DETAIL_NS::character_pointer_range< ::UChar32> t = { p1, p2, };
|
||||
const BOOST_REGEX_DETAIL_NS::character_pointer_range< ::UChar32>* p = std::lower_bound(ranges_begin, ranges_end, t);
|
||||
|
@ -193,7 +193,7 @@ BOOST_REGEX_DECL bool BOOST_REGEX_CALL is_combining_implementation(boost::uint_l
|
||||
//
|
||||
// these are the POSIX collating names:
|
||||
//
|
||||
BOOST_REGEX_DECL const char* def_coll_names[] = {
|
||||
BOOST_REGEX_DECL extern const char* const def_coll_names[] = {
|
||||
"NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "alert", "backspace", "tab", "newline",
|
||||
"vertical-tab", "form-feed", "carriage-return", "SO", "SI", "DLE", "DC1", "DC2", "DC3", "DC4", "NAK",
|
||||
"SYN", "ETB", "CAN", "EM", "SUB", "ESC", "IS4", "IS3", "IS2", "IS1", "space", "exclamation-mark",
|
||||
@ -214,7 +214,7 @@ BOOST_REGEX_DECL const char* def_coll_names[] = {
|
||||
// little more - but this will have to do for
|
||||
// now:
|
||||
|
||||
BOOST_REGEX_DECL const char* def_multi_coll[] = {
|
||||
BOOST_REGEX_DECL extern const char* const def_multi_coll[] = {
|
||||
"ae",
|
||||
"Ae",
|
||||
"AE",
|
||||
|
Reference in New Issue
Block a user