On 5/22/06, Garrett Rooney <firstname.lastname@example.org> wrote:
> On 5/21/06, Stefan Küng <email@example.com> wrote:
> > Hi,
> > Had some time to go through all the crashreports I got for TSVN:
> > If a valid (but not very usable, I admit) url is passed to some (or
> > all?) Subversion API's, it will crash.
> > Unfortunately, I can't reproduce this with the CL client, I guess it's
> > because it parses the URL first for peg revisions and that function
> > errors out for such urls. But the API should error out too if it can't
> > do anything with the url - most other clients don't have the pegrev
> > syntax as the CL client and therefore don't use that checking function.
> > For example, passing "svn+ssh:" as the URL to svn_client_ls() will crash
> > in svn_path_uri_decode(), because the path is NULL. That's because in
> > the outer function find_tunnel_agent(), the hostinfo string is NULL
> > (which is of course correct, because there is no hostinfo in that url).
> > This applies to Subversion 1.3.1, the 1.4.x branch and trunk.
> There's an interesting question here. We generally require that
> arguments passed to our functions be valid, and if they aren't we tend
> to die quickly and brutally. For example, if you pass non-cannonical
> paths to a svn function you're likely to hit an assert rather quickly.
> Are URLs like this considered valid or not?
I'd say that a library always should check (and reject if necessary)
all inputs and not crash.
But in this case, I think this is more important than usual. Because
an url like 'svn+ssh://' is a valid url according to the specs, but
not for Subversion. So how can you expect clients using your library
to know what urls are valid for Subversion and which ones are not?
Since only Subversion knows what it considers valid, it should also do
Or at least provide another API function to check the url for validity.
Otherwise, clients using the API will have a hard time figuring out
all the possible cases which Subversion doesn't like in an url and
which ones it considers valid.
oo // \\ "De Chelonian Mobile"
(_,\/ \_/ \ TortoiseSVN
\ \_/_\_/> The coolest Interface to (Sub)Version Control
/_/ \_\ http://tortoisesvn.tigris.org
To unsubscribe, e-mail: firstname.lastname@example.org
For additional commands, e-mail: email@example.com
Received on Tue May 23 08:34:31 2006