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

Re: svn commit: r1362480 - /subversion/trunk/subversion/libsvn_fs/fs-loader.c

From: Blair Zajac <blair_at_orcaware.com>
Date: Tue, 17 Jul 2012 09:48:25 -0700

On 7/17/12 6:17 AM, philip_at_apache.org wrote:
> Author: philip
> Date: Tue Jul 17 13:17:34 2012
> New Revision: 1362480
>
> URL: http://svn.apache.org/viewvc?rev=1362480&view=rev
> Log:
> * subversion/libsvn_fs/fs-loader.c
> (load_module): Only allow alphanumeric characters in name.
>

> apr_status_t status;
> + apr_size_t i;
> +
> + /* Demand a simple alphanumeric name so that the generated DSO
> + name is sensible. */
> + for (i = 0; i < strlen(name); ++i)
> + if (!svn_ctype_isalnum(name[i]))
> + return svn_error_createf(SVN_ERR_FS_UNKNOWN_FS_TYPE, NULL,
> + _("Invalid name for FS type '%s'"),
> + name);

This code doesn't probably get run often, but generally it's better to iterate
through name using pointers instead of strlen() since the later scans the string
twice.

Blair
Received on 2012-07-17 18:49:01 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.