parser: Duplicate locale
The Release testing revealed that compiler might free temporary std::locale instances sooner than we thought, exposing UaF. On 64-bit arch, a reference takes 8 bytes, a std::locale copy takes 16 bytes. So duplicating a locale in each parser instance is not such a big deal to risk an UaF. Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
parent
127704d2d8
commit
38fac2837f
@ -148,7 +148,7 @@ namespace stdex
|
||||
interval<size_t> interval; ///< Test for interval
|
||||
|
||||
protected:
|
||||
const std::locale& m_locale;
|
||||
std::locale m_locale;
|
||||
};
|
||||
|
||||
using parser = basic_parser<char>;
|
||||
|
Loading…
x
Reference in New Issue
Block a user