This is an automated email from the ASF dual-hosted git repository. lukaszlenart pushed a commit to branch WW-4692-encoder-decoder in repository https://gitbox.apache.org/repos/asf/struts.git
commit 813e938f88a7f48e72924f6d8dbb5efdbcc5538d Author: Lukasz Lenart <lukaszlen...@apache.org> AuthorDate: Wed Oct 26 11:42:23 2022 +0200 WW-4692 Fixes int promotion behaviour --- core/src/main/java/org/apache/struts2/url/StrutsUrlDecoder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/org/apache/struts2/url/StrutsUrlDecoder.java b/core/src/main/java/org/apache/struts2/url/StrutsUrlDecoder.java index 5b2ad73da..3a480d87f 100644 --- a/core/src/main/java/org/apache/struts2/url/StrutsUrlDecoder.java +++ b/core/src/main/java/org/apache/struts2/url/StrutsUrlDecoder.java @@ -83,7 +83,7 @@ public class StrutsUrlDecoder implements UrlDecoder { if (ix + 2 > len) { throw new IllegalArgumentException("The % character must be followed by two hexadecimal digits"); } - b = (byte) (((convertHexDigit(bytes[ix++]) << 4) + convertHexDigit(bytes[ix++])) & 0xff); + b = (byte) ((((convertHexDigit(bytes[ix++]) << 4) & 0xff) + convertHexDigit(bytes[ix++]) & 0xff) & 0xff); } bytes[ox++] = b; }