[Uml-devel] KDE/kdesdk/umbrello/umbrello

Albert Astals Cid tsdgeos at terra.es
Sun Jun 22 17:44:56 UTC 2008


SVN commit 823169 by aacid:

You can't do 
const char* f = format.toAscii().constData();
and then use f.

If you do, you are using the address of a temporary and it will crash your program

CCMAIL: sharanrao at gmail.com



 M  +2 -1      uml.cpp  


--- trunk/KDE/kdesdk/umbrello/umbrello/uml.cpp #823168:823169
@@ -1271,7 +1271,8 @@
 {
     QStringList supportedFormats = mimeData->formats();
     foreach( const QString &format, supportedFormats ) {
-        const char* f = format.toAscii().constData();
+        QByteArray fba = format.toAscii();
+        const char* f = fba.constData();
         if ( !qstrnicmp(f,"application/x-uml-clip", 22) ) {
             //FIXME need to test for clip1, clip2, clip3, clip4 or clip5
             //(the only valid clip types)




More information about the umbrello-devel mailing list