[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: Philip Martin <philip_at_codematters.co.uk>
Date: 2004-12-06 16:19:47 CET

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.

> +
> + if (svn_ctype_iscntrl(path[i]))
> + return svn_error_createf(SVN_ERR_FS_PATH_SYNTAX, NULL,
> + "Invalid control character in '%s'",
> + svn_path_local_style (path, pool));
> + }
> +
> + return SVN_NO_ERROR;
> +}

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Dec 6 16:21:10 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.