VirtualBox

Ignore:
Timestamp:
Dec 13, 2017 1:53:56 PM (7 years ago)
Author:
vboxsync
Message:

FE/Qt: VBoxGlobal: Fix for use after free done in r104346, (s.a. r106981).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp

    r70007 r70110  
    36743674    QString vmNameOrUuid;
    36753675
    3676     const QStringList arguments = qApp->arguments();
     3676    const QStringList &arguments = QCoreApplication::arguments();
    36773677    const int argc = arguments.size();
    36783678    int i = 1;
    36793679    while (i < argc)
    36803680    {
    3681         QByteArray  argBytes = arguments.at(i).toUtf8();
     3681        const QByteArray &argBytes = arguments.at(i).toUtf8();
    36823682        const char *arg = argBytes.constData();
    36833683        /* NOTE: the check here must match the corresponding check for the
     
    37273727            {
    37283728                size_t cbFile;
    3729                 const char *pszFile = arguments.at(i).toLocal8Bit().constData();
     3729                const QByteArray &argFileBytes = arguments.at(i).toLocal8Bit();
     3730                const char *pszFile = argFileBytes.constData();
    37303731                bool fStdIn = !::strcmp(pszFile, "stdin");
    37313732                int vrc = VINF_SUCCESS;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette