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

Re: crash with incomplete url

From: Stefan Küng <tortoisesvn_at_gmail.com>
Date: 2006-05-23 19:09:28 CEST

Peter N. Lundblad wrote:
> Stefan Küng writes:
>
> > I'd say that a library always should check (and reject if necessary)
> > all inputs and not crash.
>
> This has been discussed before, and a C library can't do that, however...

It can't do it if e.g. a client passes invalid pointers to the lib. But
checking strings is absolutely possible for the lib.

> > 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
> > the checking.
>
> My position on this is that svn_path_canonicalize should not crash fro
> any string, and no library function should crash on any string
> returned by svn_path_canonicalize. So, I agree with Stefan. This is
> a corner-case, in which we're misbehaving.

If you're expecting every client to call svn_path_canonicalize() first,
then why don't you just do that for every public function yourself? I
mean I think it's better done in the library than force every client to
do it.
And another thing: right now, the docs only mention that paths have to
be canonicalized before passing them to the APIs. It isn't mentioned
that svn_path_canonicalize() must be used for it! There are other API
(OS, other libraries) which do canonicalization, and a client might use
those to do the job. So the Subversion docs should either mention that
svn_path_canonicalize() must be used and called, or it should call that
function itself first on every passed path.

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.tigris.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue May 23 19:10:04 2006

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.