diff options
author | awnuk <awnuk@c9f7a03b-bd48-0410-a16d-cbbf54688b0b> | 2011-08-02 00:00:30 +0000 |
---|---|---|
committer | awnuk <awnuk@c9f7a03b-bd48-0410-a16d-cbbf54688b0b> | 2011-08-02 00:00:30 +0000 |
commit | bfc084ae3d23bb33fce94abf0e81525704f2932c (patch) | |
tree | 9a189b1d700e0ef21ac63d1dc539ee32d98da7e2 /pki/base | |
parent | f34898a84f4ff2ee2940a547efa83267fc1ec7ac (diff) | |
download | pki-bfc084ae3d23bb33fce94abf0e81525704f2932c.tar.gz pki-bfc084ae3d23bb33fce94abf0e81525704f2932c.tar.xz pki-bfc084ae3d23bb33fce94abf0e81525704f2932c.zip |
Fixed bugzilla bug #717041 - Improve escaping of some enrollment inputs
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/pki/trunk@2092 c9f7a03b-bd48-0410-a16d-cbbf54688b0b
Diffstat (limited to 'pki/base')
-rw-r--r-- | pki/base/common/src/com/netscape/cms/servlet/base/CMSServlet.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/pki/base/common/src/com/netscape/cms/servlet/base/CMSServlet.java b/pki/base/common/src/com/netscape/cms/servlet/base/CMSServlet.java index 9e0f1f32c..c823143be 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/base/CMSServlet.java +++ b/pki/base/common/src/com/netscape/cms/servlet/base/CMSServlet.java @@ -2283,8 +2283,21 @@ public abstract class CMSServlet extends HttpServlet { if (c == ',' || c == '=' || c == '+' || c == '<' || c == '>' || c == '#' || c == ';' || c == '\r' || c == '\n' || c == '\\' || c == '"') { + if ((c == 0x5c) && ((i+1) < v.length())) { + int nextC = v.charAt(i+1); + if ((c == 0x5c) && (nextC == ',' || nextC == '=' || nextC == '+' || + nextC == '<' || nextC == '>' || nextC == '#' || + nextC == ';' || nextC == '\r' || nextC == '\n' || + nextC == '\\' || nextC == '"')) { + if (doubleEscape) result.append('\\'); + } else { result.append('\\'); if (doubleEscape) result.append('\\'); + } + } else { + result.append('\\'); + if (doubleEscape) result.append('\\'); + } } if (c == '\r') { result.append("0D"); |