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

[wc-propcaching] Use of uninitialized variable (libsvn_wc/props.c)

From: Erik Huelsmann <ehuels_at_gmail.com>
Date: 2005-11-20 14:23:34 CET

I get a gcc warning about base_props being used uninitialized in
svn_wc__load_props.

I propose this patch to fix it:

Index: subversion/libsvn_wc/props.c
===================================================================
--- subversion/libsvn_wc/props.c (revision 17455)
+++ subversion/libsvn_wc/props.c (working copy)
@@ -387,11 +387,14 @@
       if (base_props_p)
         *base_props_p = base_props;
     }
+ else
+ base_props = NULL;

   if (props_p)
     {
       if (has_propcaching && ! entry->prop_mods && entry->has_props)
- *props_p = apr_hash_copy (pool, base_props);
+ *props_p = base_props
+ ? apr_hash_copy (pool, base_props) : apr_hash_make (pool);
       else if (! has_propcaching || entry->has_props)
         {
           const char *prop_path;

bye,

Erik.
Received on Sun Nov 20 14:24:05 2005

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.