VirtualBox

Changeset 102932 in vbox


Ignore:
Timestamp:
Jan 17, 2024 4:32:10 PM (14 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
161160
Message:

Guest Properties/HostService: Fixed too strict debug assertions for property name / value length checks, which will happen with old(er) Guest Additions installed. Regression of r150110.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/HostServices/GuestPropertySvc.h

    r98103 r102932  
    8787DECLINLINE(int) GuestPropValidateName(const char *pszName, size_t cbName)
    8888{
    89     /* Property name is expected to be at least 1 charecter long plus terminating character. */
    90     AssertReturn(cbName >= 2, VERR_INVALID_PARAMETER);
    91     AssertReturn(cbName <= GUEST_PROP_MAX_NAME_LEN, VERR_INVALID_PARAMETER);
     89    if (   cbName < 2 /* Property name is expected to be at least 1 charecter long plus terminating character. */
     90        || cbName > GUEST_PROP_MAX_NAME_LEN)
     91        return VERR_INVALID_PARAMETER;
    9292
    9393    AssertPtrReturn(pszName, VERR_INVALID_POINTER);
     
    118118    /* Zero-length values are possible, however buffer should contain terminating character at least. */
    119119    AssertReturn(cbValue > 0, VERR_INVALID_PARAMETER);
    120     AssertReturn(cbValue <= GUEST_PROP_MAX_VALUE_LEN, VERR_TOO_MUCH_DATA);
     120
     121    if (cbValue > GUEST_PROP_MAX_VALUE_LEN)
     122        return VERR_TOO_MUCH_DATA;
    121123
    122124    return VINF_SUCCESS;
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