<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1252">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hi, it has been a few years since I submitted Konsole to coverity
but w/ all the recent changes I uploaded a build based on the
master branch.<br>
</p>
<div class="moz-forward-container">Kurt<br>
<br>
-------- Forwarded Message --------
<table class="moz-email-headers-table" cellspacing="0"
cellpadding="0" border="0">
<tbody>
<tr>
<th valign="BASELINE" nowrap="nowrap" align="RIGHT">Subject:
</th>
<td>New Defects reported by Coverity Scan for Konsole</td>
</tr>
<tr>
<th valign="BASELINE" nowrap="nowrap" align="RIGHT">Date: </th>
<td>Thu, 18 Jul 2019 15:14:32 +0000 (UTC)</td>
</tr>
<tr>
<th valign="BASELINE" nowrap="nowrap" align="RIGHT">From: </th>
<td><a class="moz-txt-link-abbreviated" href="mailto:scan-admin@coverity.com">scan-admin@coverity.com</a></td>
</tr>
<tr>
<th valign="BASELINE" nowrap="nowrap" align="RIGHT">To: </th>
<td><a class="moz-txt-link-abbreviated" href="mailto:kurt.hindenburg@gmail.com">kurt.hindenburg@gmail.com</a></td>
</tr>
</tbody>
</table>
<br>
<br>
Hi,<br>
<br>
Please find the latest report on new defect(s) introduced to
Konsole found with Coverity Scan.<br>
<br>
7 new defect(s) introduced to Konsole found with Coverity Scan.<br>
14 defect(s), reported by Coverity Scan earlier, were marked fixed
in the recent build analyzed by Coverity Scan.<br>
<br>
New defect(s) Reported-by: Coverity Scan<br>
Showing 7 of 7 defect(s)<br>
<br>
<br>
** CID 241679: (RESOURCE_LEAK)<br>
/zpool/projects/Devel/KDE/src/konsole/src/autotests/KeyboardTranslatorTest.cpp:
143 in Konsole::KeyboardTranslatorTest::testHexKeys()()<br>
/zpool/projects/Devel/KDE/src/konsole/src/autotests/KeyboardTranslatorTest.cpp:
148 in Konsole::KeyboardTranslatorTest::testHexKeys()()<br>
/zpool/projects/Devel/KDE/src/konsole/src/autotests/KeyboardTranslatorTest.cpp:
147 in Konsole::KeyboardTranslatorTest::testHexKeys()()<br>
/zpool/projects/Devel/KDE/src/konsole/src/autotests/KeyboardTranslatorTest.cpp:
144 in Konsole::KeyboardTranslatorTest::testHexKeys()()<br>
<br>
<br>
________________________________________________________________________________________________________<br>
*** CID 241679: (RESOURCE_LEAK)<br>
/zpool/projects/Devel/KDE/src/konsole/src/autotests/KeyboardTranslatorTest.cpp:
143 in Konsole::KeyboardTranslatorTest::testHexKeys()()<br>
137 138 // A worthless check ATM<br>
139 if (reader.parseError()) {<br>
140 QFAIL("Parse failure");<br>
141 }<br>
142
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite"> CID 241679: (RESOURCE_LEAK)<br>
Variable "translator" going out of scope leaks the storage
it points to.<br>
</blockquote>
</blockquote>
</blockquote>
143 QCOMPARE(QStringLiteral("testtranslator"),
translator->name());<br>
144 QCOMPARE(QString(), translator->description());<br>
145 146 auto entry = translator->findEntry(Qt::Key_Backspace,
nullptr);<br>
147 QVERIFY(!entry.isNull());<br>
148 QCOMPARE(FallbackKeyboardTranslator::Command::NoCommand,
entry.command());<br>
/zpool/projects/Devel/KDE/src/konsole/src/autotests/KeyboardTranslatorTest.cpp:
148 in Konsole::KeyboardTranslatorTest::testHexKeys()()<br>
142 143 QCOMPARE(QStringLiteral("testtranslator"),
translator->name());<br>
144 QCOMPARE(QString(), translator->description());<br>
145 146 auto entry = translator->findEntry(Qt::Key_Backspace,
nullptr);<br>
147 QVERIFY(!entry.isNull());<br>
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite"> CID 241679: (RESOURCE_LEAK)<br>
Variable "translator" going out of scope leaks the storage
it points to.<br>
</blockquote>
</blockquote>
</blockquote>
148 QCOMPARE(FallbackKeyboardTranslator::Command::NoCommand,
entry.command());<br>
149 QCOMPARE(int(Qt::Key_Backspace), entry.keyCode());<br>
150 QCOMPARE(QByteArray("\x7F"), entry.text());<br>
151 QCOMPARE(QByteArray("\\x7f"), entry.escapedText());<br>
152 QCOMPARE(Qt::KeyboardModifiers(Qt::NoModifier),
entry.modifiers());<br>
153 QCOMPARE(Qt::KeyboardModifiers(Qt::NoModifier),
entry.modifierMask());<br>
/zpool/projects/Devel/KDE/src/konsole/src/autotests/KeyboardTranslatorTest.cpp:
147 in Konsole::KeyboardTranslatorTest::testHexKeys()()<br>
141 }<br>
142 143 QCOMPARE(QStringLiteral("testtranslator"),
translator->name());<br>
144 QCOMPARE(QString(), translator->description());<br>
145 146 auto entry = translator->findEntry(Qt::Key_Backspace,
nullptr);<br>
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite"> CID 241679: (RESOURCE_LEAK)<br>
Variable "translator" going out of scope leaks the storage
it points to.<br>
</blockquote>
</blockquote>
</blockquote>
147 QVERIFY(!entry.isNull());<br>
148 QCOMPARE(FallbackKeyboardTranslator::Command::NoCommand,
entry.command());<br>
149 QCOMPARE(int(Qt::Key_Backspace), entry.keyCode());<br>
150 QCOMPARE(QByteArray("\x7F"), entry.text());<br>
151 QCOMPARE(QByteArray("\\x7f"), entry.escapedText());<br>
152 QCOMPARE(Qt::KeyboardModifiers(Qt::NoModifier),
entry.modifiers());<br>
/zpool/projects/Devel/KDE/src/konsole/src/autotests/KeyboardTranslatorTest.cpp:
144 in Konsole::KeyboardTranslatorTest::testHexKeys()()<br>
138 // A worthless check ATM<br>
139 if (reader.parseError()) {<br>
140 QFAIL("Parse failure");<br>
141 }<br>
142 143 QCOMPARE(QStringLiteral("testtranslator"),
translator->name());<br>
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite"> CID 241679: (RESOURCE_LEAK)<br>
Variable "translator" going out of scope leaks the storage
it points to.<br>
</blockquote>
</blockquote>
</blockquote>
144 QCOMPARE(QString(), translator->description());<br>
145 146 auto entry = translator->findEntry(Qt::Key_Backspace,
nullptr);<br>
147 QVERIFY(!entry.isNull());<br>
148 QCOMPARE(FallbackKeyboardTranslator::Command::NoCommand,
entry.command());<br>
149 QCOMPARE(int(Qt::Key_Backspace), entry.keyCode());<br>
<br>
** CID 241678: Resource leaks (RESOURCE_LEAK)<br>
/zpool/projects/Devel/KDE/src/konsole/src/KeyBindingEditor.cpp:
309 in Konsole::KeyBindingEditor::accept()()<br>
<br>
<br>
________________________________________________________________________________________________________<br>
*** CID 241678: Resource leaks (RESOURCE_LEAK)<br>
/zpool/projects/Devel/KDE/src/konsole/src/KeyBindingEditor.cpp:
309 in Konsole::KeyBindingEditor::accept()()<br>
303 }<br>
304 305 const auto newTranslator = new
KeyboardTranslator(*_translator);<br>
306 307 if (newTranslator->description().isEmpty()) {<br>
308 KMessageBox::sorry(this, i18n("A key bindings scheme cannot be
saved with an empty description."));<br>
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite"> CID 241678: Resource leaks
(RESOURCE_LEAK)<br>
Variable "newTranslator" going out of scope leaks the
storage it points to.<br>
</blockquote>
</blockquote>
</blockquote>
309 return;<br>
310 }<br>
311 312 if (_isNewTranslator) {<br>
313 newTranslator->setName(newTranslator->description());<br>
314 }<br>
<br>
** CID 241677: Low impact quality (MISSING_MOVE_ASSIGNMENT)<br>
/zpool/projects/Devel/KDE/src/konsole/tools/uni2characterwidth/template.h:
30 in ()<br>
<br>
<br>
________________________________________________________________________________________________________<br>
*** CID 241677: Low impact quality (MISSING_MOVE_ASSIGNMENT)<br>
/zpool/projects/Devel/KDE/src/konsole/tools/uni2characterwidth/template.h:
30 in ()<br>
24 25 #include <QMap><br>
26 #include <QString><br>
27 #include <QVector><br>
28 29 // QVariant doesn't offer modification in place. Var does.<br>
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite"> CID 241677: Low impact quality
(MISSING_MOVE_ASSIGNMENT)<br>
Class "Var" may benefit from adding a move assignment
operator. See other events which show the copy assignment
operator being applied to rvalue(s), where a move assignment
may be faster.<br>
</blockquote>
</blockquote>
</blockquote>
30 class Var {<br>
31 public:<br>
32 using Number = qint64;<br>
33 using String = QString;<br>
34 using Map = QMap<String, Var>;<br>
35 using Vector = QVector<Var>;<br>
<br>
** CID 241676: Resource leaks (RESOURCE_LEAK)<br>
/src/autotests/TerminalCharacterDecoderTest_autogen/EWIEGA46WW/moc_TerminalCharacterDecoderTest.cpp:
93 in
Konsole::TerminalCharacterDecoderTest::qt_static_metacall(QObject
*, QMetaObject::Call, int, void **)()<br>
<br>
<br>
________________________________________________________________________________________________________<br>
*** CID 241676: Resource leaks (RESOURCE_LEAK)<br>
/src/autotests/TerminalCharacterDecoderTest_autogen/EWIEGA46WW/moc_TerminalCharacterDecoderTest.cpp:
93 in
Konsole::TerminalCharacterDecoderTest::qt_static_metacall(QObject
*, QMetaObject::Call, int, void **)()<br>
87 {<br>
88 if (_c == QMetaObject::InvokeMetaMethod) {<br>
89 auto *_t = static_cast<TerminalCharacterDecoderTest
*>(_o);<br>
90 Q_UNUSED(_t)<br>
91 switch (_id) {<br>
92 case 0: { Character* _r =
_t->convertToCharacter((*reinterpret_cast< const
QString(*)>(_a[1])),(*reinterpret_cast<
QVector<RenditionFlags>(*)>(_a[2])));<br>
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite"> CID 241676: Resource leaks
(RESOURCE_LEAK)<br>
Variable "_r" going out of scope leaks the storage it points
to.<br>
</blockquote>
</blockquote>
</blockquote>
93 if (_a[0]) *reinterpret_cast< Character**>(_a[0]) =
std::move(_r); } break;<br>
94 case 1: _t->testPlainTextDecoder(); break;<br>
95 case 2: _t->testPlainTextDecoder_data(); break;<br>
96 case 3: _t->testHTMLDecoder(); break;<br>
97 case 4: _t->testHTMLDecoder_data(); break;<br>
98 default: ;<br>
<br>
** CID 241675: (UNINTENDED_INTEGER_DIVISION)<br>
/zpool/projects/Devel/KDE/src/konsole/src/TerminalDisplay.cpp: 728
in Konsole::TerminalDisplay::drawCursor(QPainter &, const
QRect &, const QColor &, const QColor &, bool &)()<br>
/zpool/projects/Devel/KDE/src/konsole/src/TerminalDisplay.cpp: 729
in Konsole::TerminalDisplay::drawCursor(QPainter &, const
QRect &, const QColor &, const QColor &, bool &)()<br>
<br>
<br>
________________________________________________________________________________________________________<br>
*** CID 241675: (UNINTENDED_INTEGER_DIVISION)<br>
/zpool/projects/Devel/KDE/src/konsole/src/TerminalDisplay.cpp: 728
in Konsole::TerminalDisplay::drawCursor(QPainter &, const
QRect &, const QColor &, const QColor &, bool &)()<br>
722 painter.setPen(cursorColor);<br>
723 724 if (_cursorShape == Enum::BlockCursor) {<br>
725 // draw the cursor outline, adjusting the area so that<br>
726 // it is draw entirely inside 'rect'<br>
727 int penWidth = qMax(1, painter.pen().width());<br>
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite"> CID 241675:
(UNINTENDED_INTEGER_DIVISION)<br>
Dividing integer expressions "penWidth" and "2", and then
converting the integer quotient to type "double". Any
remainder, or fractional part of the quotient, is ignored.<br>
</blockquote>
</blockquote>
</blockquote>
728 painter.drawRect(cursorRect.adjusted(penWidth / 2 + 0.5,<br>
729 penWidth / 2 + 0.5,<br>
730 - penWidth / 2 - penWidth % 2 + 0.5,<br>
731 - penWidth / 2 - penWidth % 2 + 0.5));<br>
732 733 // draw the cursor body only when the widget has focus<br>
/zpool/projects/Devel/KDE/src/konsole/src/TerminalDisplay.cpp: 729
in Konsole::TerminalDisplay::drawCursor(QPainter &, const
QRect &, const QColor &, const QColor &, bool &)()<br>
723 724 if (_cursorShape == Enum::BlockCursor) {<br>
725 // draw the cursor outline, adjusting the area so that<br>
726 // it is draw entirely inside 'rect'<br>
727 int penWidth = qMax(1, painter.pen().width());<br>
728 painter.drawRect(cursorRect.adjusted(penWidth / 2 + 0.5,<br>
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite"> CID 241675:
(UNINTENDED_INTEGER_DIVISION)<br>
Dividing integer expressions "penWidth" and "2", and then
converting the integer quotient to type "double". Any
remainder, or fractional part of the quotient, is ignored.<br>
</blockquote>
</blockquote>
</blockquote>
729 penWidth / 2 + 0.5,<br>
730 - penWidth / 2 - penWidth % 2 + 0.5,<br>
731 - penWidth / 2 - penWidth % 2 + 0.5));<br>
732 733 // draw the cursor body only when the widget has focus<br>
734 if (hasFocus()) {<br>
<br>
** CID 241674: (RESOURCE_LEAK)<br>
/zpool/projects/Devel/KDE/src/konsole/src/autotests/KeyboardTranslatorTest.cpp:
104 in Konsole::KeyboardTranslatorTest::testFallback()()<br>
/zpool/projects/Devel/KDE/src/konsole/src/autotests/KeyboardTranslatorTest.cpp:
105 in Konsole::KeyboardTranslatorTest::testFallback()()<br>
/zpool/projects/Devel/KDE/src/konsole/src/autotests/KeyboardTranslatorTest.cpp:
108 in Konsole::KeyboardTranslatorTest::testFallback()()<br>
<br>
<br>
________________________________________________________________________________________________________<br>
*** CID 241674: (RESOURCE_LEAK)<br>
/zpool/projects/Devel/KDE/src/konsole/src/autotests/KeyboardTranslatorTest.cpp:
104 in Konsole::KeyboardTranslatorTest::testFallback()()<br>
98 99 // Use FallbackKeyboardTranslator to test basic
functionality<br>
100 void KeyboardTranslatorTest::testFallback()<br>
101 {<br>
102 auto fallback = new FallbackKeyboardTranslator();<br>
103
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite"> CID 241674: (RESOURCE_LEAK)<br>
Variable "fallback" going out of scope leaks the storage it
points to.<br>
</blockquote>
</blockquote>
</blockquote>
104 QCOMPARE(QStringLiteral("fallback"), fallback->name());<br>
105 QCOMPARE(QStringLiteral("Fallback Keyboard Translator"),
fallback->description());<br>
106 107 auto entries = fallback->entries();<br>
108 QCOMPARE(1, entries.size());<br>
109 auto entry = fallback->findEntry(Qt::Key_Tab, nullptr);<br>
/zpool/projects/Devel/KDE/src/konsole/src/autotests/KeyboardTranslatorTest.cpp:
105 in Konsole::KeyboardTranslatorTest::testFallback()()<br>
99 // Use FallbackKeyboardTranslator to test basic functionality<br>
100 void KeyboardTranslatorTest::testFallback()<br>
101 {<br>
102 auto fallback = new FallbackKeyboardTranslator();<br>
103 104 QCOMPARE(QStringLiteral("fallback"), fallback->name());<br>
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite"> CID 241674: (RESOURCE_LEAK)<br>
Variable "fallback" going out of scope leaks the storage it
points to.<br>
</blockquote>
</blockquote>
</blockquote>
105 QCOMPARE(QStringLiteral("Fallback Keyboard Translator"),
fallback->description());<br>
106 107 auto entries = fallback->entries();<br>
108 QCOMPARE(1, entries.size());<br>
109 auto entry = fallback->findEntry(Qt::Key_Tab, nullptr);<br>
110 QVERIFY(!entry.isNull());<br>
/zpool/projects/Devel/KDE/src/konsole/src/autotests/KeyboardTranslatorTest.cpp:
108 in Konsole::KeyboardTranslatorTest::testFallback()()<br>
102 auto fallback = new FallbackKeyboardTranslator();<br>
103 104 QCOMPARE(QStringLiteral("fallback"), fallback->name());<br>
105 QCOMPARE(QStringLiteral("Fallback Keyboard Translator"),
fallback->description());<br>
106 107 auto entries = fallback->entries();<br>
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite"> CID 241674: (RESOURCE_LEAK)<br>
Variable "fallback" going out of scope leaks the storage it
points to.<br>
</blockquote>
</blockquote>
</blockquote>
108 QCOMPARE(1, entries.size());<br>
109 auto entry = fallback->findEntry(Qt::Key_Tab, nullptr);<br>
110 QVERIFY(!entry.isNull());<br>
111 QCOMPARE(FallbackKeyboardTranslator::Command::NoCommand,
entry.command());<br>
112 QCOMPARE(int(Qt::Key_Tab), entry.keyCode());<br>
113 QCOMPARE(QByteArray("\t"), entry.text());<br>
<br>
** CID 187355: Resource leaks (VIRTUAL_DTOR)<br>
/usr/include/x86_64-linux-gnu/qt5/QtCore/qsharedpointer_impl.h:
141 in ()<br>
<br>
<br>
________________________________________________________________________________________________________<br>
*** CID 187355: Resource leaks (VIRTUAL_DTOR)<br>
/usr/include/x86_64-linux-gnu/qt5/QtCore/qsharedpointer_impl.h:
141 in ()<br>
135 // "weakref" is the outer reference counter and it tracks the
lifetime of<br>
136 // the ExternalRefCountData object.<br>
137 //<br>
138 // The deleter is stored in the destroyer member and is always
a pointer to<br>
139 // a static function in ExternalRefCountWithCustomDeleter or
in<br>
140 // ExternalRefCountWithContiguousData<br>
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite"> CID 187355: Resource leaks
(VIRTUAL_DTOR)<br>
Class "QtSharedPointer::ExternalRefCountData" does not have
a virtual destructor.<br>
</blockquote>
</blockquote>
</blockquote>
141 struct ExternalRefCountData<br>
142 {<br>
143 typedef void (*DestroyerFn)(ExternalRefCountData *);<br>
144 QBasicAtomicInt weakref;<br>
145 QBasicAtomicInt strongref;<br>
146 DestroyerFn destroyer;<br>
<br>
<br>
_<br>
</div>
</body>
</html>