[Uml-devel] [Bug 287179] Segmentation fault when copy&paste of sequence diagram

Ralf Habacker ralf.habacker at gmail.com
Mon Jan 16 11:29:07 UTC 2012


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


Ralf Habacker <ralf.habacker at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
                 CC|                            |ralf.habacker at gmail.com
     Ever Confirmed|0                           |1




--- Comment #3 from Ralf Habacker <ralf habacker gmail com>  2012-01-16 11:29:07 ---
The problem is a faulty implementation of the PointArray class, which is used
by  IDChangeLog. 

In 
void IDChangeLog::addIDChange(Uml::IDType OldID, Uml::IDType NewID)

it resizes the array 

        pos = m_LogArray.size();
        m_LogArray.resize(pos + 1);

and adds the point
        m_LogArray.setPoint(pos, NewID, OldID);

which is implemented as 

void  setPoint(uint i, const Uml::IDType &x, const Uml::IDType &y) {
            QVector<Point*>::insert(i, new Point(x, y));

The resize adds a 0 pointer at position 0, the ::insert insert the new point at
position 0, which moves the 0 pointer to index 1. 

void QVector::insert ( int i, const T & value ) says: 

Inserts value at index position i in the vector. If i is 0, the value is
prepended to the vector. If i is size(), the value is appended to the vector.

That identifies the resize() as the problem.

-- 
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