[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r33254 - trunk/subversion/libsvn_subr

From: Branko ÄŒibej <brane_at_xbc.nu>
Date: Wed, 24 Sep 2008 23:05:35 +0200

Stefan Küng wrote:
> Julian Foad wrote:
>
>> On Wed, 2008-09-24 at 10:49 +0200, Stefan Küng wrote:
>>
>>> Julian Foad wrote:
>>>
>>>> On Tue, 2008-09-23 at 10:20 -0700, steveking_at_tigris.org wrote:
>>>>
>>>>> Author: steveking
>>>>> Date: Tue Sep 23 10:20:15 2008
>>>>> New Revision: 33254
>>>>>
>>>>> Log:
>>>>> Prevent segfault when Windows paths with forward slashes are passed.
>>>>>
>>>>> * subversion/libsvn_subr/path.c
>>>>> (svn_path_canonicalize): only treat the path as an URI if the hostname is
>>>>> valid.
>>>>>
>>>> I'm trying to understand this change. What is an example of a path that
>>>> made it seg-fault? Do you know why it seg-faults on Windows but not un
>>>> Linux?
>>>>
>>> I haven't tested on Linux, but I assume that if it would crash with
>>> forward-slash paths, that would have been noticed immediately.
>>>
>>> A windows path has a colon and a slash (e.g., C:/) which I think is
>>> interpreted by apr as an url part, and I'd say that's the reason why
>>> apr_uri_parse doesn't return with an error.
>>>
>> On my copy of APR (v1.2.2), apr_uri_parse("C:/") gives {scheme = 0x0,
>> hostinfo = 0x0, user = 0x0, password = 0x0, hostname = 0x0, port_str =
>> 0x0, path = 0x8080e50 "C:/", query = 0x0, fragment = 0x0, hostent = 0x0,
>> port = 0, is_initialized = 1, dns_looked_up = 0, dns_resolved = 0}.
>>
>
> apr v1.3.3, apr-util v1.3.4, apr_uri_parse("c:/") gives:
> scheme = "c", hostinfo = 0x0, user = 0x0, password = 0x0, hostname =
> 0x0, port_str = 0x0, path = "/", query = 0x0, fragment = 0x0, hostent =
> 0x0, port = 0, is_initialized = 1, dns_looked_up = 0, dns_resolved = 0
>
> apr_uri_parse("c:/folder") gives:
> scheme = "c", hostinfo = 0x0, user = 0x0, password = 0x0, hostname =
> 0x0, port_str = 0x0, path = "/folder", query = 0x0, fragment = 0x0,
> hostent = 0x0, port = 0, is_initialized = 1, dns_looked_up = 0,
> dns_resolved = 0
>

So clearly we should take this to the APR list then. Unless we decide
that the original bug is to use apr_uri_parse on something that is not a
URI.

-- Brane

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-09-24 23:05:53 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.