Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@dpelle
Copy link
Member

@dpelle dpelle commented Feb 14, 2017

This PR fixes an invalid memory access in Vim-8.0.329 and older when
the 'complete' option is set with a single trailing backslash:

:set complete=s\

Valgrind error:

==23076== Invalid read of size 1
==23076==    at 0x4F54AB: did_set_string_option.constprop.10 (option.c:7018)
==23076==    by 0x4FAD30: do_set (option.c:5006)
==23076==    by 0x46B734: do_one_cmd (ex_docmd.c:2981)
==23076==    by 0x46B734: do_cmdline (ex_docmd.c:1120)
==23076==    by 0x4D71E4: nv_colon (normal.c:5403)
==23076==    by 0x4E0EF1: normal_cmd (normal.c:1150)
==23076==    by 0x5BED24: main_loop (main.c:1315)
==23076==    by 0x5BFDF2: vim_main2 (main.c:877)
==23076==    by 0x40C3D3: main (main.c:415)
==23076==  Address 0x9854eb3 is 0 bytes after a block of size 3 alloc'd
==23076==    at 0x4C2ABF5: malloc (vg_replace_malloc.c:299)
==23076==    by 0x4C4D0B: lalloc (misc2.c:942)
==23076==    by 0x4FA72A: do_set (option.c:4796)
==23076==    by 0x46B734: do_one_cmd (ex_docmd.c:2981)
==23076==    by 0x46B734: do_cmdline (ex_docmd.c:1120)
==23076==    by 0x4D71E4: nv_colon (normal.c:5403)
==23076==    by 0x4E0EF1: normal_cmd (normal.c:1150)
==23076==    by 0x5BED24: main_loop (main.c:1315)
==23076==    by 0x5BFDF2: vim_main2 (main.c:877)
==23076==    by 0x40C3D3: main (main.c:415)

Bug was found using afl-fuzz.

@brammool
Copy link
Contributor

brammool commented Feb 17, 2017 via email

@brammool brammool closed this in 226c534 Feb 17, 2017
chrisbra pushed a commit to chrisbra/vim that referenced this pull request Mar 25, 2017
…lash

Problem:    Illegal memory access when 'complete' ends in a backslash.
Solution:   Check for trailing backslash. (Dominique Pelle, closes vim#1478)
desvp pushed a commit to desvp/vim that referenced this pull request May 30, 2017
…lash

Problem:    Illegal memory access when 'complete' ends in a backslash.
Solution:   Check for trailing backslash. (Dominique Pelle, closes vim#1478)
nateozem pushed a commit to nateozem/neovim that referenced this pull request Oct 5, 2017
Problem:    Illegal memory access when 'complete' ends in a backslash.
Solution:   Check for trailing backslash. (Dominique Pelle, closes vim/vim#1478)

vim/vim@226c534
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.

2 participants