Changeset 73804 in vbox
- Timestamp:
- Aug 21, 2018 4:21:23 PM (6 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
-
idl/VirtualBox.xidl (modified) (4 diffs)
-
src-server/MachineImpl.cpp (modified) (2 diffs)
-
src-server/VirtualBoxImpl.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/idl/VirtualBox.xidl
r73768 r73804 2745 2745 2746 2746 <note> 2747 Key must contain only printable ASCII characters. 2748 </note> 2749 <note> 2747 2750 Before performing the actual data change, this method will ask all 2748 2751 registered event listener using the … … 2766 2769 <result name="E_ACCESSDENIED"> 2767 2770 Modification request refused. 2771 </result> 2772 <result name="E_INVALIDARG"> 2773 Key contains invalid characters. 2768 2774 </result> 2769 2775 … … 6958 6964 6959 6965 <note> 6966 Key must contain only printable ASCII characters. 6967 </note> 6968 <note> 6960 6969 Before performing the actual data change, this method will ask all 6961 6970 registered listeners using the … … 6981 6990 <result name="VBOX_E_XML_ERROR"> 6982 6991 Could not parse the settings file. 6992 </result> 6993 <result name="E_INVALIDARG"> 6994 Key contains invalid characters. 6983 6995 </result> 6984 6996 -
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r73744 r73804 69 69 #include <iprt/sha.h> 70 70 #include <iprt/string.h> 71 #include <iprt/ctype.h> 71 72 72 73 #include <VBox/com/array.h> … … 5072 5073 HRESULT Machine::setExtraData(const com::Utf8Str &aKey, const com::Utf8Str &aValue) 5073 5074 { 5075 /* Because non-ASCII characters in aKey have caused problems in the settings 5076 * they are rejected unless the key should be deleted. */ 5077 if (!aValue.isEmpty()) 5078 { 5079 for (int i = 0; i < aKey.length(); ++i) 5080 { 5081 char ch = aKey[i]; 5082 if (!RTLocCIsPrint(ch)) 5083 return E_INVALIDARG; 5084 } 5085 } 5086 5074 5087 Utf8Str strOldValue; // empty 5075 5088 -
trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp
r73716 r73804 32 32 #include <iprt/uuid.h> 33 33 #include <iprt/cpp/xml.h> 34 #include <iprt/ctype.h> 34 35 35 36 #include <VBox/com/com.h> … … 2068 2069 const com::Utf8Str &aValue) 2069 2070 { 2070 2071 2071 Utf8Str strKey(aKey); 2072 2072 Utf8Str strValue(aValue); 2073 2073 Utf8Str strOldValue; // empty 2074 2074 HRESULT rc = S_OK; 2075 2076 /* Because non-ASCII characters in aKey have caused problems in the settings 2077 * they are rejected unless the key should be deleted. */ 2078 if (!strValue.isEmpty()) 2079 { 2080 for (int i = 0; i < strKey.length(); ++i) 2081 { 2082 char ch = strKey[i]; 2083 if (!RTLocCIsPrint(ch)) 2084 return E_INVALIDARG; 2085 } 2086 } 2075 2087 2076 2088 // locking note: we only hold the read lock briefly to look up the old value,
Note:
See TracChangeset
for help on using the changeset viewer.

