VirtualBox

Changeset 94992 in vbox


Ignore:
Timestamp:
May 12, 2022 1:47:24 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
151417
Message:

FE/VBoxManage: Fix crash when not providing a password for a VM, bugref:9955

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp

    r94660 r94992  
    822822        return errorSyntax(Misc::tr("at least one VM name or uuid required"));
    823823
    824     if (!RTStrCmp(pszPassword, "-"))
    825     {
    826         /* Get password from console. */
    827         RTEXITCODE rcExit = readPasswordFromConsole(&strPassword, "Enter the password:");
    828         if (rcExit == RTEXITCODE_FAILURE)
    829             return rcExit;
    830     }
    831     else
    832     {
    833         RTEXITCODE rcExit = readPasswordFile(pszPassword, &strPassword);
    834         if (rcExit == RTEXITCODE_FAILURE)
    835         {
    836             RTMsgError("Failed to read new password from file");
    837             return rcExit;
     824    if (pszPassword)
     825    {
     826        if (!RTStrCmp(pszPassword, "-"))
     827        {
     828            /* Get password from console. */
     829            RTEXITCODE rcExit = readPasswordFromConsole(&strPassword, "Enter the password:");
     830            if (rcExit == RTEXITCODE_FAILURE)
     831                return rcExit;
     832        }
     833        else
     834        {
     835            RTEXITCODE rcExit = readPasswordFile(pszPassword, &strPassword);
     836            if (rcExit == RTEXITCODE_FAILURE)
     837            {
     838                RTMsgError("Failed to read new password from file");
     839                return rcExit;
     840            }
    838841        }
    839842    }
Note: See TracChangeset for help on using the changeset viewer.

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