From f3ce23230e596c6494cba583bbeb230909e11f79 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Wed, 30 Nov 2022 00:09:37 +0100 Subject: [PATCH] TextEditor: Init markWidth variable Otherwise some overrides of extraAreaWidth() may leave passed value unmodified and we may end up with uninitialized value. Change-Id: Ica89019fc2cff93f0bc7d784624730ec9d8c0224 Reviewed-by: David Schulz --- src/plugins/texteditor/texteditor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 56627add292..3594493013b 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -5886,7 +5886,7 @@ void TextEditorWidget::extraAreaMouseEvent(QMouseEvent *e) { QTextCursor cursor = cursorForPosition(QPoint(0, e->pos().y())); - int markWidth; + int markWidth = 0; extraAreaWidth(&markWidth); const bool inMarkArea = e->pos().x() <= markWidth && e->pos().x() >= 0;