| Summary: | UrlEncoded.decodeToUtf8 should either catch/ignore NotUtf8Exceptions or not | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [RT] Jetty | Reporter: | Thomas Becker <tbecker> | ||||
| Component: | server | Assignee: | Greg Wilkins <gregw> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | jetty-inbox | ||||
| Version: | unspecified | ||||||
| Target Milestone: | 7.5.x | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Created attachment 210017 [details]
proposed patch
thomas, your patch reformatted the code with wrong curly style. it's also using tabs rather than spaces. Can you make sure you have the jetty code styles applied to you IDE fixed in ee9e195b4938cb3b05d02c6739285b36ed5d40c3 and also a small test harness added. |
Build Identifier: There's two method implementations there: 1st is "UrlEncoded.decodeUtf8To(byte[] raw,int offset, int length, MultiMap map,Utf8StringBuilder buffer)" which does a: catch(NotUtf8Exception e) { LOG.warn(e.toString()); LOG.debug(e); } Thus invalid chars get replaced and the exception is ignored. 2nd is "decodeUtf8To(InputStream in, MultiMap map, int maxLength, int maxKeys)" which doesn't catch the exception and thus throws it up the stack. We should either reject URLs containing invalid utf8 chars or always replace them. Reproducible: Always