Commit 659de779 authored by Victor Zverovich's avatar Victor Zverovich

Fix a UB in parse_format_specs when begin is null

parent 51b14b6c
...@@ -2487,7 +2487,7 @@ FMT_CONSTEXPR FMT_INLINE auto parse_format_specs(const Char* begin, ...@@ -2487,7 +2487,7 @@ FMT_CONSTEXPR FMT_INLINE auto parse_format_specs(const Char* begin,
const Char* end, const Char* end,
SpecHandler&& handler) SpecHandler&& handler)
-> const Char* { -> const Char* {
if (begin + 1 < end && begin[1] == '}' && is_ascii_letter(*begin) && if (1 < end - begin && begin[1] == '}' && is_ascii_letter(*begin) &&
*begin != 'L') { *begin != 'L') {
presentation_type type = parse_presentation_type(*begin++); presentation_type type = parse_presentation_type(*begin++);
if (type == presentation_type::none) if (type == presentation_type::none)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment