Oop. Since you're offline for a couple more days, I went ahead and
fixed this. r39856.
On Wed, Oct 7, 2009 at 20:52, Greg Stein <gstein_at_gmail.com> wrote:
> On Fri, Oct 2, 2009 at 13:22, Hyrum K. Wright <hyrum_at_hyrumwright.org> wrote:
>>...
>> +++ trunk/subversion/libsvn_fs_fs/fs_fs.c    Fri Oct  2 10:22:06 2009     (r39768)
>>...
>> @@ -6185,18 +6172,17 @@ recover_find_max_ids(svn_fs_t *fs, svn_r
>> Â iterpool = svn_pool_create(pool);
>> Â for (hi = apr_hash_first(NULL, entries); hi; hi = apr_hash_next(hi))
>> Â Â {
>> - Â Â Â void *val;
>> Â Â Â char *str_val;
>> Â Â Â char *str, *last_str;
>> Â Â Â svn_node_kind_t kind;
>> Â Â Â svn_fs_id_t *id;
>> Â Â Â const char *node_id, *copy_id;
>> Â Â Â apr_off_t child_dir_offset;
>> + Â Â Â const char *path = svn_apr_hash_index_val(hi);
>>
>> Â Â Â svn_pool_clear(iterpool);
>>
>> - Â Â Â apr_hash_this(hi, NULL, NULL, &val);
>> - Â Â Â str_val = apr_pstrdup(iterpool, *((char **)val));
>> + Â Â Â str_val = apr_pstrdup(iterpool, path);
>
> This is an incorrect transformation.
>
> The original code was being "too smart" and knew that val was an
> svn_string_t* and that val->data is the first member, thus deref'ing a
> char** would be equivalent to fetching val->data.
>
> So. You want something like:
>
> Â svn_string_t *path = svn_apr_hash_index_val(hi);
> ...
> Â str_val = apr_pstrdup(iterpool, path->data);
>
> As it stands, you're dup'ing the svn_string_t structure itself.
>
>>...
>
> Cheers,
> -g
>
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2404754
Received on 2009-10-08 02:57:47 CEST