Bug 52479 - apr_uri_parse("@localhost::8080") reports "@localhost" for the scheme
Summary: apr_uri_parse("@localhost::8080") reports "@localhost" for the scheme
Status: RESOLVED FIXED
Alias: None
Product: APR
Classification: Unclassified
Component: APR-util (show other bugs)
Version: HEAD
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache Portable Runtime bugs mailinglist
URL:
Keywords: FixedInTrunk
Depends on:
Blocks:
 
Reported: 2012-01-17 21:41 UTC by Jeff Trawick
Modified: 2013-08-13 20:08 UTC (History)
0 users



Attachments
proof of concept fix (991 bytes, patch)
2013-03-24 08:47 UTC, Stefan Fritsch
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff Trawick 2012-01-17 21:41:54 UTC
Try calling apr_uri_parse() with "@localhost::8080" for the URI.  "@localhost" is reported as the scheme, but "@" is not a valid scheme character.

(See http://www.ietf.org/rfc/rfc2396.txt.)
Comment 1 Stefan Fritsch 2013-03-24 08:47:25 UTC
Created attachment 30098 [details]
proof of concept fix

The fix should go like this, but of course using strspn() is very inefficient.

I have noticed that we don't have a locale-independent isalnum() in apr. Should we add that or should we do some character table tricks like we do in httpd's test_char.h?
Comment 2 Stefan Fritsch 2013-03-28 17:39:50 UTC
Trunk fix: r1462219 and r1462224
Comment 3 Stefan Fritsch 2013-03-29 10:40:48 UTC
1.5.x commit: r1462434
Comment 4 Stefan Fritsch 2013-04-05 20:24:52 UTC
fixed in 1.5.2
Comment 5 Mike Rumph 2013-08-13 20:08:46 UTC
The fix for this bug listed in comments 2 through 4 result in a regression to APR-util 1.5.2 which shows up as a regression to mod_proxy interpolation code in Apache httpd 2.2.25.

This regression was reported in httpd bug 55315.