Updated Branches: refs/heads/4.2 71b36e8ff -> 016faeaf2
CLOUDSTACK-3274: guard a null string case in case of string match. Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/016faeaf Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/016faeaf Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/016faeaf Branch: refs/heads/4.2 Commit: 016faeaf283e8478bb703e5922dfef5ca973805b Parents: 71b36e8 Author: Min Chen <[email protected]> Authored: Fri Aug 16 10:51:25 2013 -0700 Committer: Min Chen <[email protected]> Committed: Fri Aug 16 10:51:25 2013 -0700 ---------------------------------------------------------------------- utils/src/com/cloud/utils/StringUtils.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/016faeaf/utils/src/com/cloud/utils/StringUtils.java ---------------------------------------------------------------------- diff --git a/utils/src/com/cloud/utils/StringUtils.java b/utils/src/com/cloud/utils/StringUtils.java index 21c7220..c02082c 100644 --- a/utils/src/com/cloud/utils/StringUtils.java +++ b/utils/src/com/cloud/utils/StringUtils.java @@ -153,8 +153,10 @@ public class StringUtils { // Responsible for stripping sensitive content from request and response strings public static String cleanString(String stringToClean){ String cleanResult = ""; - cleanResult = REGEX_PASSWORD_QUERYSTRING.matcher(stringToClean).replaceAll(""); - cleanResult = REGEX_PASSWORD_JSON.matcher(cleanResult).replaceAll(""); + if (stringToClean != null) { + cleanResult = REGEX_PASSWORD_QUERYSTRING.matcher(stringToClean).replaceAll(""); + cleanResult = REGEX_PASSWORD_JSON.matcher(cleanResult).replaceAll(""); + } return cleanResult; }
