#358 Vim parser: Segmentation fault when reaing empty vim file

open
nobody
None
5
2014-09-19
2014-06-20
Ariya Mizutani
No

This patch solves the problem.

diff --git a/vim.c b/vim.c
index fb971ea..d1285eb 100644
--- a/vim.c
+++ b/vim.c
@@ -717,6 +717,11 @@ static void findVimTags (void)

        line = readVimLine();

+       if (line == NULL)
+       {
+               return;
+       }
+
        if ( strncmp ((const char*) line, "UseVimball", (size_t) 10) == 0 )
        {
                parseVimBallFile (line);

Discussion

  • Can I merge this patch to https://github.com/fishman/ctags?
    A pull-request to the repository makes me much more happy:)

     
  • David Fishburn
    David Fishburn
    2014-09-19

    I can't for some reason assign this issue to myself, but I have submitted the code to fix this issue in trunk:

    Adding Test\bug358.vim
    Sending vim.c
    Transmitting file data ..
    Committed revision 811.