VirtualBox

Ignore:
Timestamp:
Jun 21, 2022 7:49:35 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
151926
Message:

GuestPropertySvc.h,Main/Settings.cpp: Made GUEST_PROP_MAX_NAME_LEN and GUEST_PROP_MAX_VALUE_LEN work like GUEST_PROP_MAX_PATTERN_LEN and be the max size of the respective strings, including the zero terminator. This way a szName[GUEST_PROP_MAX_NAME_LEN] variable will be the exact max size of a property name, rather than one byte more than the max which was the previous weirdness. bugref:10185

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/xml/Settings.cpp

    r95325 r95334  
    46754675            /** @todo r=bird: Should add a RTCString method for this, as this may create a
    46764676             *        invalid UTF-8 encoding if we chop up a UTF-8 sequence. */
    4677             Assert(prop.strValue.length() + 1 >= GUEST_PROP_MAX_VALUE_LEN);
    4678             prop.strValue.mutableRaw()[GUEST_PROP_MAX_VALUE_LEN - 2] = '\0';
     4677            Assert(prop.strValue.length() + 1 > GUEST_PROP_MAX_VALUE_LEN);
     4678            prop.strValue.mutableRaw()[GUEST_PROP_MAX_VALUE_LEN - 1] = '\0';
    46794679            prop.strValue.jolt();
    46804680        }
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