[Uml-devel] [Bug 230770] Segfault importing Java code (project and single class) into Umbrello [QString::operator==, JavaImport::joinTypename, JavaImport::parseStmt]

geroxp at web.de geroxp at web.de
Tue Apr 20 12:56:45 UTC 2010


https://bugs.kde.org/show_bug.cgi?id=230770





--- Comment #3 from  <geroxp web de>  2010-04-20 14:56:41 ---
This is a patch for a workaround of the crash that I experienced. It may be a
dirty patch, but for me it works:

--- javaimport.cpp    2009-06-03 13:54:28.000000000 +0200
+++ ../../../../../kdesdk-4.3.2/umbrello/umbrello/codeimport/javaimport.cpp   
2010-04-20 14:13:29.711275970 +0200
@@ -77,8 +77,11 @@
         }
     }
     // to handle multidimensional arrays, call recursively
-    if (m_source[m_srcIndex + 1] == "[") {
-        typeNameRet = joinTypename( typeNameRet );
+
+    if (m_srcIndex<(sizeof(m_source) / sizeof(int))) {
+    if (m_source[m_srcIndex + 1] == "[") {
+        typeNameRet = joinTypename( typeNameRet );
+    }
     }
     return typeNameRet;
 }
@@ -581,8 +584,13 @@
     }
     // reset visibility to default
     m_currentAccess = m_defaultCurrentAccess;
-    if (m_source[m_srcIndex] != ";") {
-        uError() << "importJava: ignoring trailing items at " << name;
+    if (m_srcIndex<(sizeof(m_source) / sizeof(int))) {
+    if (m_source[m_srcIndex] != ";") {
+        uError() << "importJava: ignoring trailing items at " << name;
+        skipStmt();
+    } 
+    } else {
+        uError() << "index out of range: ignoring statement " << name;
         skipStmt();
     }
     return true;

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.




More information about the umbrello-devel mailing list