mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-04 20:29:27 +01:00
CS-14796: Error out with InvalidParameterValueException in UserVmManagerImpl if userdata is not base64 encoded.
This commit is contained in:
parent
a7d2a08c5e
commit
1c96ef41c1
@ -2558,6 +2558,9 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
|
||||
private void validateUserData(String userData) {
|
||||
byte[] decodedUserData = null;
|
||||
if (userData != null) {
|
||||
if (!Base64.isBase64(userData)) {
|
||||
throw new InvalidParameterValueException("User data is not base64 encoded");
|
||||
}
|
||||
if (userData.length() >= 2 * MAX_USER_DATA_LENGTH_BYTES) {
|
||||
throw new InvalidParameterValueException("User data is too long");
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user