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

Re: [PATCH] First cut at 1954 solution

From: Peter N. Lundblad <peter_at_famlundblad.se>
Date: 2004-12-06 21:11:37 CET

On Mon, 6 Dec 2004, Philip Martin wrote:

> VK Sameer <sameer@collab.net> writes:
>
> > +svn_error_t*
> > +svn_path_is_valid_in_svn (const char *path,
> > + apr_size_t len,
> > + apr_pool_t *pool)
> > +{
> > + int i;
> > + for (i = 0; i < len; i++)
> > + {
> > + if (!svn_ctype_isutf8(path[i]))
> > + return svn_error_createf(SVN_ERR_FS_PATH_SYNTAX, NULL,
> > + "Invalid UTF8 character in '%s'",
> > + svn_path_local_style (path, pool));
>
> UTF-8 is a multibyte encoding so this doesn't ensure that the path is
> valid UTF-8. We already have code to check for valid UTF-8, see
> utf_validate.c, and it's already in use. The above is either
> redundant if combined with the existing code, or insufficient if it
> replaces the existing code.
>
> I think you should either drop attempts to test UTF-8 or build on the
> existing UTF-8 validation code.
>
It is redundant, since we already do this check when converting from
native to UTF8, even if native is UTF8. Validating input on the server
side when expecting valid UTF8 wouldn't hurt, though.

//Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Dec 6 21:12:32 2004

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.