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

Re: svn commit: r37508 - trunk/subversion/libsvn_wc

From: Greg Stein <gstein_at_gmail.com>
Date: Thu, 30 Apr 2009 15:18:12 +0200

That's not quite sufficient. If prophash is NULL, then you never set 'value'.

On Thu, Apr 30, 2009 at 09:11, Senthil Kumaran S <senthil_at_collab.net> wrote:
> Author: stylesen
> Date: Thu Apr 30 00:11:32 2009
> New Revision: 37508
>
> Log:
> Follow up r37355.
>
> * subversion/libsvn_wc/props.c
>  (svn_wc__internal_propget): Avoid potential segfault since 'prophash'
>   may be NULL.
>
> Modified:
>   trunk/subversion/libsvn_wc/props.c
>
> Modified: trunk/subversion/libsvn_wc/props.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_wc/props.c?pathrev=37508&r1=37507&r2=37508
> ==============================================================================
> --- trunk/subversion/libsvn_wc/props.c  Wed Apr 29 23:48:53 2009        (r37507)
> +++ trunk/subversion/libsvn_wc/props.c  Thu Apr 30 00:11:32 2009        (r37508)
> @@ -1779,7 +1779,7 @@ svn_wc__internal_propget(const svn_strin
>                          apr_pool_t *scratch_pool)
>  {
>   svn_error_t *err;
> -  apr_hash_t *prophash;
> +  apr_hash_t *prophash = NULL;
>   enum svn_prop_kind kind = svn_property_kind(NULL, name);
>   const svn_wc_entry_t *entry;
>
> @@ -1823,8 +1823,8 @@ svn_wc__internal_propget(const svn_strin
>                                    result_pool, scratch_pool),
>                 _("Failed to load properties from disk"));
>     }
> -
> -  *value = apr_hash_get(prophash, name, APR_HASH_KEY_STRING);
> +  if (prophash)
> +    *value = apr_hash_get(prophash, name, APR_HASH_KEY_STRING);
>
>   return SVN_NO_ERROR;
>  }
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=495&dsMessageId=1992441
>

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1995081
Received on 2009-04-30 15:18:31 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.