[patch] bad memory access when inserting comment leader

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[patch] bad memory access when inserting comment leader

Lech Lorens
Steps to reproduce:
- start Vim with the following command:
$ vim -u NONE -U NONE -c 'set fo=or com=s\:/*,mb\:***,ex\:*/'
- enter insert mode and insert the following:
     /*
- open a new line below either by pressing Enter in insert mode or by
  pressing "o" in normal mode.

Vim will crash.

If you fail to reproduce the crash, change the number of spaces before
the opening comment (the more spaces, the further beyond the allocated
buffer writing will occur). Note that it is essential that the middle
comment leader be longer than the opening one.

The attached patch fixes the problem.

--
Cheers,
Lech

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---


comment-bad-memory-access.patch (415 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [patch] bad memory access when inserting comment leader

Bram Moolenaar


Lech Lorens wrote:

> Steps to reproduce:
> - start Vim with the following command:
> $ vim -u NONE -U NONE -c 'set fo=or com=s\:/*,mb\:***,ex\:*/'
> - enter insert mode and insert the following:
>      /*
> - open a new line below either by pressing Enter in insert mode or by
>   pressing "o" in normal mode.
>
> Vim will crash.
>
> If you fail to reproduce the crash, change the number of spaces before
> the opening comment (the more spaces, the further beyond the allocated
> buffer writing will occur). Note that it is essential that the middle
> comment leader be longer than the opening one.
>
> The attached patch fixes the problem.

Thanks!

--
OLD WOMAN: King of the WHO?
ARTHUR:    The Britons.
OLD WOMAN: Who are the Britons?
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [hidden email] -- 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
-~----------~----~----~----~------~----~------~--~---