cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edi...@apache.org
Subject [8/41] git commit: CS-14796: Error out with InvalidParameterValueException in UserVmManagerImpl if userdata is not base64 encoded.
Date Wed, 12 Sep 2012 06:43:29 GMT
CS-14796: Error out with InvalidParameterValueException in UserVmManagerImpl if userdata is
not base64 encoded.


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/cc80d09d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/cc80d09d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/cc80d09d

Branch: refs/heads/4.0
Commit: cc80d09d77455d79d67ec5875283b37158af130d
Parents: bfcc31d
Author: Likitha Shetty <Likitha.Shetty@citrix.com>
Authored: Tue Sep 11 16:57:07 2012 -0700
Committer: Prachi Damle <prachi@cloud.com>
Committed: Tue Sep 11 16:58:09 2012 -0700

----------------------------------------------------------------------
 server/src/com/cloud/vm/UserVmManagerImpl.java |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/cc80d09d/server/src/com/cloud/vm/UserVmManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java
index a1241da..73a60ce 100755
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@ -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");
             }


Mime
View raw message