Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix buffer overflow in Markdown parser
This fixes a buffer overflow that happened when parsing a bad Markdown file with an unclosed emphasis nested in other elements, such as ```markdown > __af_err af_flip(af_array *out, const af_array in, const unsigned dim)__ ``` This snippet comes from the ArrayFire repository [1]. The problem was found after the refactoring [2] that introduced std::string_view in the code. The `std::string_view::operator[]` has bounds checking enabled when the macro `_GLIBCXX_ASSERTIONS` is defined, which is the case of Arch Linux build system. [1] https://github.com/arrayfire/arrayfire/blob/0a25d36238aa1eee3b775d3584937ca65b0a1807/docs/pages/matrix_manipulation.md [2] f4e3751
- Loading branch information