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

[PATCH] fix uninitialized return value in svn_client_root_url_from_path

From: Stefan Küng <tortoisesvn_at_gmail.com>
Date: 2007-09-22 16:57:05 CEST

Hi,

If svn_client_root_url_from_path() is called without initializing the
return value first to NULL, the function fails without returning an
error. This is bad.

Attached is a patch which fixes this problem by initializing the return
value first - otherwise the check on line 244 in
subversion/libsvn_client/util.c fails even though it shouldn't.

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.net

[[[
Initialize the return value to NULL.
* subversion/libsvn_client/util.c
  (svn_client__get_repos_root): initialize the return string to NULL
]]]
Index: subversion/libsvn_client/util.c
===================================================================
--- subversion/libsvn_client/util.c (revision 26727)
+++ subversion/libsvn_client/util.c (working copy)
@@ -214,6 +214,7 @@
   svn_boolean_t need_wc_cleanup = FALSE;
   svn_error_t *err = SVN_NO_ERROR;
 
+ *repos_root = NULL;
   /* If PATH_OR_URL is a local path and PEG_REVISION keeps us looking
      locally, we'll first check PATH_OR_URL's entry for a repository
      root URL. */

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Sep 22 16:57:23 2007

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.