Bug 1105521

Summary: FastURLDecoder cannot decode surrogate pair characters
Product: [JBoss] JBoss Enterprise Portal Platform 6 Reporter: Takayuki Konishi <tkonishi>
Component: PortalAssignee: Lucas Ponce <lponce>
Status: CLOSED UPSTREAM QA Contact: Tomas Kyjovsky <tkyjovsk>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.1.1CC: epp-bugs, lponce, ppalaga
Target Milestone: ER09   
Target Release: 6.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-02-10 03:36:01 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
a patch for testcase. none

Description Takayuki Konishi 2014-06-06 10:17:39 UTC
Description of problem:

FastURLDecoder cannot decode surrogate pair characters.
When I decoded U+20000B, I got NullPointerException:

java.lang.NullPointerException
	at org.gatein.common.text.FastURLDecoder$LookupNonTerm.access$1(FastURLDecoder.java:269)
	at org.gatein.common.text.FastURLDecoder.safeEncode(FastURLDecoder.java:215)
	at org.gatein.common.text.AbstractCharEncoder.encode(AbstractCharEncoder.java:45)
	at org.gatein.common.text.AbstractCharEncoder.encode(AbstractCharEncoder.java:62)
	at org.gatein.common.text.FastURLDecoderTestCase.testEncodeSurrogatePair(FastURLDecoderTestCase.java:259)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at junit.framework.TestCase.runTest(TestCase.java:164)
	at junit.framework.TestCase.runBare(TestCase.java:130)
	at junit.framework.TestResult$1.protect(TestResult.java:106)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.framework.TestResult.run(TestResult.java:109)
	at junit.framework.TestCase.run(TestCase.java:120)
	at junit.framework.TestSuite.runTest(TestSuite.java:230)
	at junit.framework.TestSuite.run(TestSuite.java:225)
	at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:131)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

I also attach a patch for testcase.

Comment 3 Lucas Ponce 2015-02-27 13:05:54 UTC
Added patch on 3.8.x upstream branch:

https://github.com/gatein/gatein-portal/pull/933

FastURLDecoder/FastURLEncoder can not be patched easily without putting in risk other layers related encoded issues.

Comment 4 Peter Palaga 2015-02-27 22:03:00 UTC
The workaround in https://github.com/gatein/gatein-portal/pull/933 was merged in upstream (3.8.x branch only).

Comment 5 Tomas Kyjovsky 2015-03-17 12:08:22 UTC
According to Lucas, the customer was satisfied with the workaround.

I tested it with dashboard on 6.2.0.ER9 and it seems to work as expected.

Comment 6 Red Hat Bugzilla 2025-02-10 03:36:01 UTC
This product has been discontinued or is no longer tracked in Red Hat Bugzilla.