forked from boostorg/regex
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
@@ -208,8 +208,8 @@ int get_default_class_id(const charT* p1, const charT* p2)
|
||||
{data+63, data+67,}, // word
|
||||
{data+67, data+73,}, // xdigit
|
||||
};
|
||||
static const character_pointer_range<charT>* ranges_begin = ranges;
|
||||
static const character_pointer_range<charT>* ranges_end = ranges + (sizeof(ranges)/sizeof(ranges[0]));
|
||||
const character_pointer_range<charT>* ranges_begin = ranges;
|
||||
const character_pointer_range<charT>* ranges_end = ranges + (sizeof(ranges)/sizeof(ranges[0]));
|
||||
|
||||
character_pointer_range<charT> t = { p1, p2, };
|
||||
const character_pointer_range<charT>* p = std::lower_bound(ranges_begin, ranges_end, t);
|
||||
|
Reference in New Issue
Block a user