New Defects reported by Coverity Scan for rhabacker/umbrello
scan-admin at coverity.com
scan-admin at coverity.com
Tue Apr 18 03:07:02 UTC 2017
Hi,
Please find the latest report on new defect(s) introduced to rhabacker/umbrello found with Coverity Scan.
7 new defect(s) introduced to rhabacker/umbrello found with Coverity Scan.
3 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 7 of 7 defect(s)
** CID 178701: Null pointer dereferences (NULL_RETURNS)
/home/coverity/src/umbrello/umbrello/codeimport/csharp/csharpimport.cpp: 630 in CSharpImport::parseEnumDeclaration()()
________________________________________________________________________________________________________
*** CID 178701: Null pointer dereferences (NULL_RETURNS)
/home/coverity/src/umbrello/umbrello/codeimport/csharp/csharpimport.cpp: 630 in CSharpImport::parseEnumDeclaration()()
624 const QString& name = advance();
625 log(QLatin1String("enum ") + name);
626 UMLObject *ns = Import_Utils::createUMLObject(UMLObject::ot_Enum,
627 name, currentScope(), m_comment);
628 UMLEnum *enumType = ns->asUMLEnum();
629 if (enumType == 0)
>>> CID 178701: Null pointer dereferences (NULL_RETURNS)
>>> Assigning: "enumType" = null return value from "remapUMLEnum".
630 enumType = Import_Utils::remapUMLEnum(ns, currentScope());
631 skipStmt(QLatin1String("{"));
632 while (m_srcIndex < m_source.count() - 1 && advance() != QLatin1String("}")) {
633 QString next = advance();
634 if (next == QLatin1String("=")) {
635 next = advance();
** CID 178700: Control flow issues (MISSING_BREAK)
/home/coverity/src/umbrello/umbrello/umllistview.cpp: 1036 in UMLListView::connectNewObjectsSlots(UMLObject *)()
________________________________________________________________________________________________________
*** CID 178700: Control flow issues (MISSING_BREAK)
/home/coverity/src/umbrello/umbrello/umllistview.cpp: 1036 in UMLListView::connectNewObjectsSlots(UMLObject *)()
1030 case UMLObject::ot_Instance:{
1031 UMLInstance *c = object->asUMLInstance();
1032 connect(c, SIGNAL(attributeAdded(UMLClassifierListItem*)), this, SLOT(childObjectAdded(UMLClassifierListItem*)));
1033 connect(c, SIGNAL(attributeRemoved(UMLClassifierListItem*)), this, SLOT(childObjectAdded(UMLClassifierListItem*)));
1034 connect(object, SIGNAL(modified()), this, SLOT(slotObjectChanged()));
1035 }
>>> CID 178700: Control flow issues (MISSING_BREAK)
>>> The above case falls through to this one.
1036 case UMLObject::ot_Enum: {
1037 UMLEnum *e = object->asUMLEnum();
1038 connect(e, SIGNAL(enumLiteralAdded(UMLClassifierListItem*)),
1039 this, SLOT(childObjectAdded(UMLClassifierListItem*)));
1040 connect(e, SIGNAL(enumLiteralRemoved(UMLClassifierListItem*)),
1041 this, SLOT(childObjectRemoved(UMLClassifierListItem*)));
** CID 178699: Incorrect expression (IDENTICAL_BRANCHES)
/umbrello/moc_instanceattribute.cpp: 76 in UMLInstanceAttribute::qt_metacall(QMetaObject::Call, int, void **)()
________________________________________________________________________________________________________
*** CID 178699: Incorrect expression (IDENTICAL_BRANCHES)
/umbrello/moc_instanceattribute.cpp: 76 in UMLInstanceAttribute::qt_metacall(QMetaObject::Call, int, void **)()
70 return UMLAttribute::qt_metacast(_clname);
71 }
72
73 int UMLInstanceAttribute::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
74 {
75 _id = UMLAttribute::qt_metacall(_c, _id, _a);
>>> CID 178699: Incorrect expression (IDENTICAL_BRANCHES)
>>> The same code is executed when the condition "_id < 0" is true or false, because the code in the if-then branch and after the if statement is identical. Should the if statement be removed?
76 if (_id < 0)
77 return _id;
78 return _id;
79 }
** CID 178698: Null pointer dereferences (FORWARD_NULL)
/home/coverity/src/umbrello/umbrello/dialogs/umlinstanceattributedialog.cpp: 52 in UMLInstanceAttributeDialog::apply()()
________________________________________________________________________________________________________
*** CID 178698: Null pointer dereferences (FORWARD_NULL)
/home/coverity/src/umbrello/umbrello/dialogs/umlinstanceattributedialog.cpp: 52 in UMLInstanceAttributeDialog::apply()()
46 } else if(value.isEmpty()) {
47 KMessageBox::error(this, i18n("You have entered an invalid attribute value."),
48 i18n("Value Invalid"), 0);
49 return false;
50 }
51 UMLClassifier * pConcept = dynamic_cast<UMLClassifier *>(m_pAttribute->parent());
>>> CID 178698: Null pointer dereferences (FORWARD_NULL)
>>> Passing null pointer "pConcept" to "findChildObject", which dereferences it. (The dereference happens because this is a virtual function call.)
52 UMLObject *o = pConcept->findChildObject(name);
53 if (o && o != m_pAttribute) {
54 KMessageBox::error(this, i18n("The attribute name you have chosen is already being used in this operation."),
55 i18n("Attribute Name Not Unique"), 0);
56 ui->nameLE->setText(m_pAttribute->name());
57 return false;
** CID 178697: Null pointer dereferences (FORWARD_NULL)
/home/coverity/src/umbrello/umbrello/umllistviewitem.cpp: 517 in UMLListViewItem::slotEditFinished(const QString &)()
________________________________________________________________________________________________________
*** CID 178697: Null pointer dereferences (FORWARD_NULL)
/home/coverity/src/umbrello/umbrello/umllistviewitem.cpp: 517 in UMLListViewItem::slotEditFinished(const QString &)()
511 case lvt_Operation: {
512 if (m_object == 0) {
513 cancelRenameWithMsg();
514 return;
515 }
516 UMLOperation *op = m_object->asUMLOperation();
>>> CID 178697: Null pointer dereferences (FORWARD_NULL)
>>> Comparing "op" to null implies that "op" might be null.
517 UMLClassifier *parent = op ? op->umlParent()->asUMLClassifier() : 0;
518 Model_Utils::OpDescriptor od;
519 Model_Utils::Parse_Status st = Model_Utils::parseOperation(newText, od, parent);
520 if (st == Model_Utils::PS_OK) {
521 // TODO: Check that no operation with the exact same profile exists.
522 UMLApp::app()->executeCommand(new Uml::CmdRenameUMLObject(op, od.m_name));
** CID 178696: Null pointer dereferences (FORWARD_NULL)
/home/coverity/src/umbrello/umbrello/codeimport/csharp/csharpimport.cpp: 636 in CSharpImport::parseEnumDeclaration()()
________________________________________________________________________________________________________
*** CID 178696: Null pointer dereferences (FORWARD_NULL)
/home/coverity/src/umbrello/umbrello/codeimport/csharp/csharpimport.cpp: 636 in CSharpImport::parseEnumDeclaration()()
630 enumType = Import_Utils::remapUMLEnum(ns, currentScope());
631 skipStmt(QLatin1String("{"));
632 while (m_srcIndex < m_source.count() - 1 && advance() != QLatin1String("}")) {
633 QString next = advance();
634 if (next == QLatin1String("=")) {
635 next = advance();
>>> CID 178696: Null pointer dereferences (FORWARD_NULL)
>>> Comparing "enumType" to null implies that "enumType" might be null.
636 if (enumType != 0)
637 Import_Utils::addEnumLiteral(enumType, m_source[m_srcIndex - 2], QString(), m_source[m_srcIndex]);
638 next = advance();
639 } else {
640 Import_Utils::addEnumLiteral(enumType, m_source[m_srcIndex - 1]);
641 }
** CID 178695: Error handling issues (CHECKED_RETURN)
/home/coverity/src/umbrello/umbrello/umldoc.cpp: 2606 in UMLDoc::loadUMLObjectsFromXMI1(QDomElement &)()
________________________________________________________________________________________________________
*** CID 178695: Error handling issues (CHECKED_RETURN)
/home/coverity/src/umbrello/umbrello/umldoc.cpp: 2606 in UMLDoc::loadUMLObjectsFromXMI1(QDomElement &)()
2600 // (<UML:Stereotype>).
2601 bool foundUmbrelloRootFolder = false;
2602 QString name = tempElement.attribute(QLatin1String("name"));
2603 for (int i = 0; i < Uml::ModelType::N_MODELTYPES; ++i) {
2604 if (name == m_root[i]->name()) {
2605 m_pCurrentRoot = m_root[i];
>>> CID 178695: Error handling issues (CHECKED_RETURN)
>>> Calling "loadFromXMI1" without checking return value (as is done elsewhere 20 out of 22 times).
2606 m_root[i]->loadFromXMI1(tempElement);
2607 foundUmbrelloRootFolder = true;
2608 break;
2609 }
2610 }
2611 if (foundUmbrelloRootFolder) {
________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRbneWfoX0F52Gghq-2BqUUFh5eVd8TaO133jUuHRtUP-2FQWy-2BSqTKvXGWB4PJ4toJHP0A-3D_EShgirRohr6FUhdhEf2AbZ1nkp0TrbQOboOeetrIkR9VjSYad3-2Fonmj5rBuAH8I4wG0AQUz-2FVLZw1Qrj88-2B3KR-2F-2B677vFV7ZfdipcfLVIa11W65KlrZdt7K-2F4KAWhNWyJXi3KShYGN8w9kLtHtndfz06Vah-2FPImigS6gPVuQ9jT7PEpvJuUcOb9Mbjrf9v1tJ0IVrbIDkBVq6XpOBzQ5wIaKcDKIFuum9cXdwvJCF8M-3D
To manage Coverity Scan email notifications for "umbrello-devel at kde.org", click https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRbVDbis712qZDP-2FA8y06Nq4SjuUo8WwZlhalaw77wxDR6TvlGtHG9IoMCHNAtdPIo0gfvkxSgjiMukzLDgKgS6BzgYg-2Fe-2FHA96GDtTS-2FfrSaW7e-2BE4SCnFcHBrZn05zc8E-3D_EShgirRohr6FUhdhEf2AbZ1nkp0TrbQOboOeetrIkR9VjSYad3-2Fonmj5rBuAH8I4UbjAyKphakyHVKgwMqLO9bjrV45bT-2Bfq3nMEBkFGtuhjNzdBhIj5ZLgk9YqRqAdtLLbIbeZDz-2Fyn1V79fnXplGd0eRiv6LYMQJh4P3hrpBtcjt1yJ9He8JCgDmCHRAZRZZWoXdSJG9-2FGjw1fUhZXv5VwbK0DpTp-2BCNED1NP3hGc-3D
More information about the umbrello-devel
mailing list