Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent a buffer-overflow when parsing the qf results #1694

Closed
wants to merge 1 commit into from

Conversation

LemonBoy
Copy link
Contributor

@LemonBoy LemonBoy commented May 9, 2017

We need to re-allocate a bigger buffer even when the old one has the
same exact size of the text we're going to write over using vim_strncpy.
This is obvious in hindsight as vim_strncpy expects 'out' to be len+1
bytes long, failure to do so resulted in silent memory corruption
leading to a crash.

We need to re-allocate a bigger buffer even when the old one has the
same exact size of the text we're going to write over using vim_strncpy.
This is obvious in hindsight as vim_strncpy expects 'out' to be len+1
bytes long, failure to do so resulted in silent memory corruption
leading to a crash.
@codecov-io
Copy link

Codecov Report

Merging #1694 into master will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1694      +/-   ##
==========================================
+ Coverage   74.85%   74.88%   +0.03%     
==========================================
  Files          76       76              
  Lines      124942   124943       +1     
==========================================
+ Hits        93521    93569      +48     
+ Misses      31421    31374      -47
Impacted Files Coverage Δ
src/quickfix.c 91.45% <100%> (ø) ⬆️
src/version.c 79.29% <0%> (-1.02%) ⬇️
src/channel.c 83.57% <0%> (-0.1%) ⬇️
src/os_unix.c 58.29% <0%> (-0.05%) ⬇️
src/if_py_both.h 76.02% <0%> (ø) ⬆️
src/screen.c 74.22% <0%> (+0.11%) ⬆️
src/term.c 53.37% <0%> (+0.17%) ⬆️
src/message.c 68.52% <0%> (+0.25%) ⬆️
src/gui_gtk_x11.c 47.44% <0%> (+0.26%) ⬆️
src/window.c 81.08% <0%> (+0.49%) ⬆️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4475b62...3fe3513. Read the comment docs.

@brammool brammool closed this in 253f912 May 15, 2017
desvp pushed a commit to desvp/vim that referenced this pull request May 30, 2017
Problem:    Off-by-one error in buffer size computation.
Solution:   Use ">=" instead of ">". (Lemonboy, closes vim#1694)
dpelle pushed a commit to dpelle/vim that referenced this pull request Jul 31, 2017
Problem:    Off-by-one error in buffer size computation.
Solution:   Use ">=" instead of ">". (Lemonboy, closes vim#1694)
jamessan added a commit to jamessan/neovim that referenced this pull request Dec 19, 2017
Problem:    Off-by-one error in buffer size computation.
Solution:   Use ">=" instead of ">". (Lemonboy, closes vim/vim#1694)

vim/vim@253f912
jamessan added a commit to jamessan/neovim that referenced this pull request Dec 19, 2017
Problem:    Off-by-one error in buffer size computation.
Solution:   Use ">=" instead of ">". (Lemonboy, closes vim/vim#1694)

vim/vim@253f912
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants