VirtualBox

Ignore:
Timestamp:
Feb 16, 2007 9:09:10 AM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
18690
Message:

Properly check number of parameters.

File:
1 edited

Legend:

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

    r775 r947  
    49414941        if (argc < 3)
    49424942            CHECK_ERROR(virtualBox, SetExtraData(Bstr(argv[1]), NULL));
     4943        else if (argc == 3)
     4944            CHECK_ERROR(virtualBox, SetExtraData(Bstr(argv[1]), Bstr(argv[2])));
    49434945        else
    4944             CHECK_ERROR(virtualBox, SetExtraData(Bstr(argv[1]), Bstr(argv[2])));
     4946            return errorSyntax(USAGE_SETEXTRADATA, "Too many parameters");
    49454947    }
    49464948    else
     
    49584960            if (argc < 3)
    49594961                CHECK_ERROR(machine, SetExtraData(Bstr(argv[1]), NULL));
     4962            else if (argc == 3)
     4963                CHECK_ERROR(machine, SetExtraData(Bstr(argv[1]), Bstr(argv[2])));
    49604964            else
    4961                 CHECK_ERROR(machine, SetExtraData(Bstr(argv[1]), Bstr(argv[2])));
     4965                return errorSyntax(USAGE_SETEXTRADATA, "Too many parameters");
    49624966        }
    49634967    }
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