Browse Source

Fixes #446 : buffer overread in Tooltip::insert_doxygen(), and added _GLIBCXX_ASSERTIONS to tests

pipelines/357160723
eidheim 4 years ago
parent
commit
d5001438c8
  1. 2
      .gitlab-ci.yml
  2. 2
      src/tooltips.cpp

2
.gitlab-ci.yml

@ -10,7 +10,7 @@ stages:
stage: test stage: test
script: script:
- mkdir build && cd build - mkdir build && cd build
- CXXFLAGS=-Werror cmake -DBUILD_TESTING=1 .. - CXXFLAGS="-Werror -D_GLIBCXX_ASSERTIONS" cmake -DBUILD_TESTING=1 ..
- make -j$(nproc) - make -j$(nproc)
- broadwayd & CTEST_OUTPUT_ON_FAILURE=1 make test - broadwayd & CTEST_OUTPUT_ON_FAILURE=1 make test

2
src/tooltips.cpp

@ -1311,9 +1311,11 @@ void Tooltip::insert_doxygen(const std::string &input_, bool remove_delimiters)
} }
else { else {
auto i2 = i_saved; auto i2 = i_saved;
if(i2 > 0) {
--i2; --i2;
while(i2 > 0 && (input[i2] == ' ' || input[i2] == '\t')) while(i2 > 0 && (input[i2] == ' ' || input[i2] == '\t'))
--i2; --i2;
}
if(input[i2] == '\n' || i2 == 0) if(input[i2] == '\n' || i2 == 0)
markdown += "\n\n"; markdown += "\n\n";
if(input[i_saved] == '\\') if(input[i_saved] == '\\')

Loading…
Cancel
Save