Re: (patch) fix access to freed memory in if_getline.c
- Dominique Pelle wrote:
> >> Function ex_window() may also free and reallocate ccline.cmdbuffThis issue is still in the todo list. Good to have something to test a
> >> hence invalidating xpc.xp_pattern.
> >> I attach an update of my previous patch which should also fix this issue.
> > This is tricky, since xp_pattern is separate from the allocated command
> > line. It's very easy to forget updating xp_pattern. One solution would
> > be to change xp_pattern from a pointer into a byte index. But there are
> > several places where the start of the command line are not known.
> > Another solution would be to make expand_T part of struct cmdline_info.
> > Then xp_pattern can be adjusted by the function reallocating the command
> > line. Code only using the expand_T doesn't need to be changed then.
> > I'll look further into this.
> Until now, I saw this bug a couple of times but never found a way to
> reproduce it easily. Well, I just found a way to reproduce this easily
> with vim-7.2.6 (also with gvim).
> 1/ start vim with:
> algrind vim -u NONE
> 2/ enter Ex command ":set nocompatible wildmenu"
> 3/ put at least one command in Ex history
> :echo "foobar"
> 4/ press Ex command ":e -" followed
Q: What is the difference betwee open-source and commercial software?
A: If you have a problem with commercial software you can call a phone
number and they will tell you it might be solved in a future version.
For open-source software there isn't a phone number to call, but you
get the solution within a day.
/// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php