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

Sharan Rao sharanrao at gmail.com
Sun Jun 22 19:22:24 UTC 2008


On Sunday 22 Jun 2008 11:14:56 pm Albert Astals Cid wrote:
> 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)

Hmm, thanks for pointing that out :). Missed it comletely :(

Cheers!
 Sharan Rao




More information about the umbrello-devel mailing list