VirtualBox

Changeset 62642 in vbox for trunk/src


Ignore:
Timestamp:
Jul 28, 2016 9:16:04 PM (8 years ago)
Author:
vboxsync
Message:

gimR3HvInit: Check VendorID length or we'll pick up random stack bits from the stack. Marked confusing RTStNCmp use.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/GIMHv.cpp

    r62641 r62642  
    223223    rc = CFGMR3QueryStringDef(pCfgHv, "VendorID", szVendor, sizeof(szVendor), "VBoxVBoxVBox");
    224224    AssertLogRelRCReturn(rc, rc);
     225    AssertLogRelMsgReturn(strlen(szVendor) == 12,
     226                          ("The VendorID config value must be exactly 12 chars, '%s' isn't!\n", szVendor),
     227                          VERR_INVALID_PARAMETER);
    225228
    226229    LogRel(("GIM: HyperV: Reporting vendor as '%s'\n", szVendor));
     230    /** @todo r=bird: GIM_HV_VENDOR_MICROSOFT is 12 char and the string is max
     231     *        12+terminator, so the NCmp is a little bit misleading. */
    227232    if (!RTStrNCmp(szVendor, GIM_HV_VENDOR_MICROSOFT, sizeof(GIM_HV_VENDOR_MICROSOFT) - 1))
    228233    {
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