You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Greg Stein <gs...@gmail.com> on 2009/04/30 13:18:12 UTC

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

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 <se...@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


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

Posted by "Hyrum K. Wright" <hy...@hyrumwright.org>.
Fixed in r37510.

On Apr 30, 2009, at 8:18 AM, Greg Stein wrote:

> 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  
> <se...@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

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1995270