]> granicus.if.org Git - vim/commitdiff
patch 8.1.0121: crash when using ballooneval related to 'vartabstop' v8.1.0121
authorBram Moolenaar <Bram@vim.org>
Thu, 28 Jun 2018 10:05:11 +0000 (12:05 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 28 Jun 2018 10:05:11 +0000 (12:05 +0200)
Problem:    Crash when using ballooneval related to 'vartabstop'.
Solution:   Initialize balloonEval->vts to NULL. (Markus Braun)

src/ex_cmds2.c
src/gui.c
src/gui_beval.c
src/gui_w32.c
src/version.c

index 01bc357f436daf64fbf3e9272279a67f2c4130f9..5f58fedfb70b459c333f111cf040da4fe991040e 100644 (file)
@@ -1419,7 +1419,7 @@ check_due_timer(void)
            bevalexpr_due_set = FALSE;
            if (balloonEval == NULL)
            {
-               balloonEval = (BalloonEval *)alloc(sizeof(BalloonEval));
+               balloonEval = (BalloonEval *)alloc_clear(sizeof(BalloonEval));
                balloonEvalForTerm = TRUE;
            }
            if (balloonEval != NULL)
index 87ea5ce2b0dd8d7d5d2e2642ea759eac2f9a60ca..f51b81f867a4893ec715d25cb9b0d7300a49e6fe 100644 (file)
--- a/src/gui.c
+++ b/src/gui.c
@@ -745,7 +745,12 @@ gui_init(void)
        /* Always create the Balloon Evaluation area, but disable it when
         * 'ballooneval' is off. */
        if (balloonEval != NULL)
+       {
+# ifdef FEAT_VARTABS
+           vim_free(balloonEval->vts);
+# endif
            vim_free(balloonEval);
+       }
        balloonEvalForTerm = FALSE;
 # ifdef FEAT_GUI_GTK
        balloonEval = gui_mch_create_beval_area(gui.drawarea, NULL,
index 7e4625080f72ad36104344cd20c97c0bd312b4b5..49694cfdda5a49175dfe78d6a23cb595e53bed47 100644 (file)
@@ -111,28 +111,19 @@ gui_mch_create_beval_area(
        return NULL;
     }
 
-    beval = (BalloonEval *)alloc(sizeof(BalloonEval));
+    beval = (BalloonEval *)alloc_clear(sizeof(BalloonEval));
     if (beval != NULL)
     {
 #ifdef FEAT_GUI_GTK
        beval->target = GTK_WIDGET(target);
-       beval->balloonShell = NULL;
-       beval->timerID = 0;
 #else
        beval->target = (Widget)target;
-       beval->balloonShell = NULL;
-       beval->timerID = (XtIntervalId)NULL;
        beval->appContext = XtWidgetToApplicationContext((Widget)target);
 #endif
        beval->showState = ShS_NEUTRAL;
-       beval->x = 0;
-       beval->y = 0;
        beval->msg = mesg;
        beval->msgCB = mesgCB;
        beval->clientData = clientData;
-#ifdef FEAT_VARTABS
-       beval->vts = NULL;
-#endif
 
        /*
         * Set up event handler which will keep its eyes on the pointer,
index 855381108b116f132f21c750e184dadb75e55831..147d98b3913774717572947419c76093906c9ff6 100644 (file)
@@ -8922,28 +8922,21 @@ gui_mch_create_beval_area(
        return NULL;
     }
 
-    beval = (BalloonEval *)alloc(sizeof(BalloonEval));
+    beval = (BalloonEval *)alloc_clear(sizeof(BalloonEval));
     if (beval != NULL)
     {
        beval->target = s_textArea;
-       beval->balloon = NULL;
 
        beval->showState = ShS_NEUTRAL;
-       beval->x = 0;
-       beval->y = 0;
        beval->msg = mesg;
        beval->msgCB = mesgCB;
        beval->clientData = clientData;
-#ifdef FEAT_VARTABS
-       beval->vts = NULL;
-#endif
 
        InitCommonControls();
        cur_beval = beval;
 
        if (p_beval)
            gui_mch_enable_beval_area(beval);
-
     }
     return beval;
 }
index aa8a1de06bb83d90c6c0e878b981f41b38ce730a..5aacf2f11f0e631b57c469db92671691bab55dd6 100644 (file)
@@ -789,6 +789,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    121,
 /**/
     120,
 /**/