From 457c28910008f964cde57d63b4690e50e852be43 Mon Sep 17 00:00:00 2001 From: Aleksey Sidorov Date: Sun, 19 Aug 2012 23:38:19 +0400 Subject: [PATCH] Fix possibly memory corruption text.toUtf8() create a temporary QByteArray object, which is then destroyed and const char *utfString may be corrupted. Change-Id: Icd6584675c0c6e25423d25129d3b6fc8b055ebf0 Reviewed-by: Eike Ziller --- src/plugins/coreplugin/progressmanager/progressmanager_mac.mm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/plugins/coreplugin/progressmanager/progressmanager_mac.mm b/src/plugins/coreplugin/progressmanager/progressmanager_mac.mm index ba0ac9cf2d2..880e2c53980 100644 --- a/src/plugins/coreplugin/progressmanager/progressmanager_mac.mm +++ b/src/plugins/coreplugin/progressmanager/progressmanager_mac.mm @@ -128,8 +128,7 @@ static ApplicationProgressView *sharedProgressView = nil; void Core::Internal::ProgressManagerPrivate::setApplicationLabel(const QString &text) { - const char *utf8String = text.toUtf8().constData(); - NSString *cocoaString = [[NSString alloc] initWithUTF8String:utf8String]; + NSString *cocoaString = [[NSString alloc] initWithUTF8String:text.toUtf8().constData()]; [[NSApp dockTile] setBadgeLabel:cocoaString]; [cocoaString release]; }