You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bh...@apache.org on 2014/09/16 17:11:23 UTC

git commit: updated refs/heads/master to 88c6072

Repository: cloudstack
Updated Branches:
  refs/heads/master ba9320091 -> 88c6072b4


CID-1237196: Fix potential NPE in SAMLUtils

Signed-off-by: Rohit Yadav <ro...@shapeblue.com>


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

Branch: refs/heads/master
Commit: 88c6072b4dd4d4bdea196e915a8c7b2bb27feba0
Parents: ba93200
Author: Rohit Yadav <ro...@shapeblue.com>
Authored: Tue Sep 16 17:10:11 2014 +0200
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Tue Sep 16 17:10:11 2014 +0200

----------------------------------------------------------------------
 utils/src/org/apache/cloudstack/utils/auth/SAMLUtils.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/88c6072b/utils/src/org/apache/cloudstack/utils/auth/SAMLUtils.java
----------------------------------------------------------------------
diff --git a/utils/src/org/apache/cloudstack/utils/auth/SAMLUtils.java b/utils/src/org/apache/cloudstack/utils/auth/SAMLUtils.java
index b08fa24..36c4d0f 100644
--- a/utils/src/org/apache/cloudstack/utils/auth/SAMLUtils.java
+++ b/utils/src/org/apache/cloudstack/utils/auth/SAMLUtils.java
@@ -225,7 +225,11 @@ public class SAMLUtils {
         Signature signature = Signature.getInstance("SHA1withRSA");
         signature.initSign(signingKey);
         signature.update(url.getBytes());
-        return url + "&Signature=" + URLEncoder.encode(Base64.encodeBytes(signature.sign(), Base64.DONT_BREAK_LINES), HttpUtils.UTF_8);
+        String signatureString = Base64.encodeBytes(signature.sign(), Base64.DONT_BREAK_LINES);
+        if (signatureString != null) {
+            return url + "&Signature=" + URLEncoder.encode(signatureString, HttpUtils.UTF_8);
+        }
+        return url;
     }
 
     public static KeyFactory getKeyFactory() {