New Defects reported by Coverity Scan for rhabacker/umbrello
scan-admin at coverity.com
scan-admin at coverity.com
Tue Nov 16 13:07:46 GMT 2021
Hi,
Please find the latest report on new defect(s) introduced to rhabacker/umbrello found with Coverity Scan.
10 new defect(s) introduced to rhabacker/umbrello found with Coverity Scan.
167 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent build analyzed by Coverity Scan.
New defect(s) Reported-by: Coverity Scan
Showing 10 of 10 defect(s)
** CID 364159: Uninitialized members (UNINIT_CTOR)
/home/ralf.habacker/src/umbrello-master/umbrello/codeimport/phpimport.cpp: 529 in DebugLanguageParserHelper<Php::ParseSession, Php::TokenStream, Php::Token, Php::Lexer, Php::StartAst, Php::DebugVisitor, (&Php::tokenText)>::DebugLanguageParserHelper(bool, bool)()
________________________________________________________________________________________________________
*** CID 364159: Uninitialized members (UNINIT_CTOR)
/home/ralf.habacker/src/umbrello-master/umbrello/codeimport/phpimport.cpp: 529 in DebugLanguageParserHelper<Php::ParseSession, Php::TokenStream, Php::Token, Php::Lexer, Php::StartAst, Php::DebugVisitor, (&Php::tokenText)>::DebugLanguageParserHelper(bool, bool)()
523 DebugLanguageParserHelper(const bool printAst, const bool printTokens)
524 : m_printAst(printAst),
525 m_printTokens(printTokens),
526 m_isFed(false)
527 {
528 m_session.setDebug(printAst);
>>> CID 364159: Uninitialized members (UNINIT_CTOR)
>>> Non-static class member "m_ast" is not initialized in this constructor nor in any functions that it calls.
529 }
530
531 /// parse contents of a file
532 bool parseFile( const QString &fileName )
533 {
534 if (!m_session.readFile(fileName, "utf-8")) {
** CID 364158: (RESOURCE_LEAK)
/home/ralf.habacker/src/umbrello-master/umbrello/docgenerators/docbookgeneratorjob.cpp: 105 in xsltprocExternalEntityLoader(const char *, const char *, _xmlParserCtxt *)()
/home/ralf.habacker/src/umbrello-master/umbrello/docgenerators/docbookgeneratorjob.cpp: 105 in xsltprocExternalEntityLoader(const char *, const char *, _xmlParserCtxt *)()
________________________________________________________________________________________________________
*** CID 364158: (RESOURCE_LEAK)
/home/ralf.habacker/src/umbrello-master/umbrello/docgenerators/docbookgeneratorjob.cpp: 105 in xsltprocExternalEntityLoader(const char *, const char *, _xmlParserCtxt *)()
99 qDebug() << "Loaded URL=\"" << newURL << "\" ID=\"" << ID << "\"";
100 xmlFree(newURL);
101 return(ret);
102 }
103 xmlFree(newURL);
104 }
>>> CID 364158: (RESOURCE_LEAK)
>>> Variable "newURL" going out of scope leaks the storage it points to.
105 }
106 if (warning != NULL) {
107 ctxt->sax->warning = warning;
108 if (_URL != NULL)
109 warning(ctxt, "failed to load external entity \"%s\"\n", _URL);
110 else if (ID != NULL)
/home/ralf.habacker/src/umbrello-master/umbrello/docgenerators/docbookgeneratorjob.cpp: 105 in xsltprocExternalEntityLoader(const char *, const char *, _xmlParserCtxt *)()
99 qDebug() << "Loaded URL=\"" << newURL << "\" ID=\"" << ID << "\"";
100 xmlFree(newURL);
101 return(ret);
102 }
103 xmlFree(newURL);
104 }
>>> CID 364158: (RESOURCE_LEAK)
>>> Variable "newURL" going out of scope leaks the storage it points to.
105 }
106 if (warning != NULL) {
107 ctxt->sax->warning = warning;
108 if (_URL != NULL)
109 warning(ctxt, "failed to load external entity \"%s\"\n", _URL);
110 else if (ID != NULL)
** CID 364157: Null pointer dereferences (FORWARD_NULL)
________________________________________________________________________________________________________
*** CID 364157: Null pointer dereferences (FORWARD_NULL)
/home/ralf.habacker/src/umbrello-master/umbrello/umllistview.cpp: 2621 in UMLListView::loadChildrenFromXMI(UMLListViewItem *, QDomElement &)()
2615 if (umlObject) {
2616 UMLInstanceAttribute *instAttr = umlObject->asUMLInstanceAttribute();
2617 connectNewObjectsSlots(instAttr);
2618 label = instAttr->toString();
2619 item = new UMLListViewItem(parent, label, lvType, instAttr);
2620 } else {
>>> CID 364157: Null pointer dereferences (FORWARD_NULL)
>>> Passing null pointer "umlObject" to "name", which dereferences it.
2621 DEBUG(DBG_SRC) << umlObject->name() << " lvt_InstanceAttribute child "
2622 << " object " << Uml::ID::toString(nID) << " not found";
2623 }
2624 } else {
2625 DEBUG(DBG_SRC) << "cast to instance object failed";
2626 }
** CID 364156: Uninitialized members (UNINIT_CTOR)
/home/ralf.habacker/src/umbrello-master/umbrello/codeimport/phpimport.cpp: 64 in Php::PHPIncludeFileVisitor::PHPIncludeFileVisitor(Php::TokenStream *, const QString &)()
________________________________________________________________________________________________________
*** CID 364156: Uninitialized members (UNINIT_CTOR)
/home/ralf.habacker/src/umbrello-master/umbrello/codeimport/phpimport.cpp: 64 in Php::PHPIncludeFileVisitor::PHPIncludeFileVisitor(Php::TokenStream *, const QString &)()
58 class PHPIncludeFileVisitor : public DefaultVisitor
59 {
60 public:
61 PHPIncludeFileVisitor(TokenStream *str, const QString& content = QString())
62 : m_str (str),
63 m_content(content)
>>> CID 364156: Uninitialized members (UNINIT_CTOR)
>>> Non-static class member "m_dependencies" is not initialized in this constructor nor in any functions that it calls.
64 {}
65 void setFilePath(const QString &path)
66 {
67 m_filePath = path;
68 }
69
** CID 364155: Uninitialized members (UNINIT_CTOR)
/home/ralf.habacker/src/umbrello-master/lib/kdev5-php/parser/php.g: 213 in Php::Parser::Parser()()
________________________________________________________________________________________________________
*** CID 364155: Uninitialized members (UNINIT_CTOR)
/home/ralf.habacker/src/umbrello-master/lib/kdev5-php/parser/php.g: 213 in Php::Parser::Parser()()
207
208 %parserclass (constructor)
209 [:
210 m_state.varExpressionState = Normal;
211 m_state.varExpressionIsVariable = false;
212 :]
>>> CID 364155: Uninitialized members (UNINIT_CTOR)
>>> Non-static class member "m_debug" is not initialized in this constructor nor in any functions that it calls.
213
214
215 %token_stream TokenStream ;;
216
217 -----------------------------------------------------------
218 -- List of defined tokens
** CID 364154: Incorrect expression (DIVIDE_BY_ZERO)
________________________________________________________________________________________________________
*** CID 364154: Incorrect expression (DIVIDE_BY_ZERO)
/home/ralf.habacker/src/umbrello-master/umbrello/umldoc.cpp: 505 in UMLDoc::openDocument(const QUrl &, const char *)()
499 newDocument();
500 return false;
501 }
502
503 m_doc_url = url;
504 closeDocument();
>>> CID 364154: Incorrect expression (DIVIDE_BY_ZERO)
>>> In function call "setResolution", division by expression "0." has undefined behavior.
505 setResolution(0.0);
506 // IMPORTANT: set m_bLoading to true
507 // _AFTER_ the call of UMLDoc::closeDocument()
508 // as it sets m_bLoading to false after it was temporarily
509 // changed to true to block recording of changes in redo-buffer
510 m_bLoading = true;
** CID 364153: (UNINIT)
/home/ralf.habacker/src/umbrello-master/umbrello/dialogs/pages/selectoperationpage.cpp: 98 in SelectOperationPage::SelectOperationPage(UMLView *, UMLClassifier *, LinkWidget *, bool)()
________________________________________________________________________________________________________
*** CID 364153: (UNINIT)
/home/ralf.habacker/src/umbrello-master/umbrello/dialogs/pages/selectoperationpage.cpp: 98 in SelectOperationPage::SelectOperationPage(UMLView *, UMLClassifier *, LinkWidget *, bool)()
92 m_docWidget = new DocumentationWidget(m_widget->operation(), this);
93 else {
94 MessageWidget *w = dynamic_cast<MessageWidget*>(m_widget);
95 if (w)
96 m_docWidget = new DocumentationWidget(w, this);
97 }
>>> CID 364153: (UNINIT)
>>> Using uninitialized value "this->m_docWidget" when calling "addWidget".
98 topLayout->addWidget(m_docWidget);
99
100 setupOperationsList();
101 setupDialog();
102 }
103
/home/ralf.habacker/src/umbrello-master/umbrello/dialogs/pages/selectoperationpage.cpp: 101 in SelectOperationPage::SelectOperationPage(UMLView *, UMLClassifier *, LinkWidget *, bool)()
95 if (w)
96 m_docWidget = new DocumentationWidget(w, this);
97 }
98 topLayout->addWidget(m_docWidget);
99
100 setupOperationsList();
>>> CID 364153: (UNINIT)
>>> Using uninitialized value "this->m_enableAutoIncrement" when calling "setupDialog".
101 setupDialog();
102 }
103
104 /**
105 * Standard destructor.
106 */
** CID 309574: Uninitialized variables (UNINIT)
/usr/include/qt5/QtCore/qlist.h: 644 in QList<QString>::prepend(const QString &)()
________________________________________________________________________________________________________
*** CID 309574: Uninitialized variables (UNINIT)
/usr/include/qt5/QtCore/qlist.h: 644 in QList<QString>::prepend(const QString &)()
638 QT_TRY {
639 n = reinterpret_cast<Node *>(p.prepend());;
640 } QT_CATCH(...) {
641 node_destruct(©);
642 QT_RETHROW;
643 }
>>> CID 309574: Uninitialized variables (UNINIT)
>>> Using uninitialized value "copy". Field "copy.v" is uninitialized.
644 *n = copy;
645 }
646 }
647 }
648
649 template <typename T>
** CID 309057: (UNINIT)
/usr/include/qt5/QtCore/qlist.h: 610 in QList<QString>::append(const QString &)()
/usr/include/qt5/QtCore/qlist.h: 610 in QList<QExplicitlySharedDataPointer<KDevelop::Problem>>::append(const QExplicitlySharedDataPointer<KDevelop::Problem> &)()
________________________________________________________________________________________________________
*** CID 309057: (UNINIT)
/usr/include/qt5/QtCore/qlist.h: 610 in QList<QString>::append(const QString &)()
604 QT_TRY {
605 n = reinterpret_cast<Node *>(p.append());;
606 } QT_CATCH(...) {
607 node_destruct(©);
608 QT_RETHROW;
609 }
>>> CID 309057: (UNINIT)
>>> Using uninitialized value "copy". Field "copy.v" is uninitialized.
610 *n = copy;
611 }
612 }
613 }
614
615 template <typename T>
/usr/include/qt5/QtCore/qlist.h: 610 in QList<QExplicitlySharedDataPointer<KDevelop::Problem>>::append(const QExplicitlySharedDataPointer<KDevelop::Problem> &)()
604 QT_TRY {
605 n = reinterpret_cast<Node *>(p.append());;
606 } QT_CATCH(...) {
607 node_destruct(©);
608 QT_RETHROW;
609 }
>>> CID 309057: (UNINIT)
>>> Using uninitialized value "copy". Field "copy.v" is uninitialized.
610 *n = copy;
611 }
612 }
613 }
614
615 template <typename T>
** CID 168196: (MISSING_MOVE_ASSIGNMENT)
/usr/include/qt5/QtCore/qlist.h: 72 in ()
/usr/include/qt5/QtCore/qlist.h: 72 in ()
________________________________________________________________________________________________________
*** CID 168196: (MISSING_MOVE_ASSIGNMENT)
/usr/include/qt5/QtCore/qlist.h: 72 in ()
66 QT_BEGIN_NAMESPACE
67
68
69 template <typename T> class QVector;
70 template <typename T> class QSet;
71
>>> CID 168196: (MISSING_MOVE_ASSIGNMENT)
>>> Class "QListSpecialMethods<UMLAttribute *>" may benefit from adding a move assignment operator. See other events which show the copy assignment operator being applied to rvalues, where a move assignment may be faster.
72 template <typename T> struct QListSpecialMethods
73 {
74 protected:
75 ~QListSpecialMethods() {}
76 };
77 template <> struct QListSpecialMethods<QByteArray>;
/usr/include/qt5/QtCore/qlist.h: 72 in ()
66 QT_BEGIN_NAMESPACE
67
68
69 template <typename T> class QVector;
70 template <typename T> class QSet;
71
>>> CID 168196: (MISSING_MOVE_ASSIGNMENT)
>>> Class "QListSpecialMethods<UMLClassifierListItem *>" may benefit from adding a move assignment operator. See other events which show the copy assignment operator being applied to rvalues, where a move assignment may be faster.
72 template <typename T> struct QListSpecialMethods
73 {
74 protected:
75 ~QListSpecialMethods() {}
76 };
77 template <> struct QListSpecialMethods<QByteArray>;
________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50ype-2BRqRsYhdjm7-2FSUoJ48b7BVHdMauqlh3oRIKVpp-2BhGqs4kJ0JMnpW-2BWlV-2Bmvd-2FoM-3DgY9o_ayU2l2PDk8Uz8GVXtvS4zFCjP9BmHG9-2FEq6MRz3uuYT-2FuWcxH992i3iQS8lAXTP-2FkU4MWVs4SegPMvRuB-2BRUsFgntubmoPIJneV9Okrhc2nrqX8txZrrdcPVtiUe5cH9Uc22beCn9moePeY-2Fo6FEul5oMHQDQdZiMhrqHyKvNn7BjUsOwzpmMBJePmx58V5s0QQXLAz7kgch71OHDNebO16qCZeGMwW6PWVw5UZCEtI-3D
More information about the umbrello-devel
mailing list