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:
Reimar Döffinger
2019-11-05 22:13:15 +01:00
committed by Reimar Döffinger
parent a550507517
commit 3168641320
4 changed files with 10 additions and 10 deletions

View File

@ -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);