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

Re: svn commit: r1095756 - in /subversion/trunk: build.conf subversion/tests/cmdline/lock-wc-dir.c subversion/tests/cmdline/svntest/actions.py subversion/tests/cmdline/svntest/main.py

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Thu, 21 Apr 2011 19:59:29 +0300

rhuijben_at_apache.org wrote on Thu, Apr 21, 2011 at 15:47:25 -0000:
> +int
> +main(int argc, const char *argv[])
> +{
> + apr_pool_t *pool;
> + int exit_code = EXIT_SUCCESS;
> + svn_error_t *err;
> + svn_boolean_t recursive;
> +
> + if (argc < 2 || argc > 3)
> + {
> + fprintf(stderr, USAGE_MSG, argv[0]);
> + exit(1);
> + }
> +

This allows argc == 2,

> + if (apr_initialize() != APR_SUCCESS)
> + {
> + fprintf(stderr, "apr_initialize() failed.\n");
> + exit(1);
> + }
> +
> + /* set up the global pool */
> + pool = svn_pool_create(NULL);
> +
> + recursive = (strcmp(argv[1], "-1") != 0);
> +
> + err = obtain_lock(argv[2], recursive, pool);

in which case argv[2] == NULL,

> +static svn_error_t *
> +obtain_lock(const char *path, svn_boolean_t recursive,
> + apr_pool_t *scratch_pool)
> +{
> + const char *local_abspath;
> + svn_wc_context_t *wc_ctx;
> +
> + SVN_ERR(svn_path_cstring_to_utf8(&path, path, scratch_pool));

which is then passed to to this function, which ultimately calls
strlen() on its second argument.

> +}
> +

In short: did you mean "if (argc != 3)"?
Received on 2011-04-21 19:00:03 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.