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

Re: [PATCH] Was: Re: Problem in 1.3.0 RC-6

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2005-12-16 22:44:38 CET

Paul Burba <paulb@softlanding.com> writes:

> Philip Martin <philip@codematters.co.uk> wrote on 12/16/2005 03:24:32 PM:
>
>> Paul Burba <paulb@softlanding.com> writes:
>>
>> > @@ -1062,18 +1062,20 @@
>> > {
>> > statstruct->ood_last_cmt_rev = b->ood_last_cmt_rev;
>> > statstruct->ood_last_cmt_date = b->ood_last_cmt_date;
>> > - statstruct->ood_last_cmt_author = b->ood_last_cmt_author;
>> > + statstruct->ood_last_cmt_author =
>> > + apr_pstrdup (pool, b->ood_last_cmt_author);
>>
>> If I delete svn:author will b->ood_last_cmt_author be NULL? If so
>> then this will dump core.
>>
>> > }
>> > }
>> > else
>> > {
>> > struct file_baton *b = baton;
>> > if (b->url)
>> > - statstruct->url = b->url;
>> > + statstruct->url = apr_pstrdup (pool, b->url);
>> > statstruct->ood_last_cmt_rev = b->ood_last_cmt_rev;
>> > statstruct->ood_last_cmt_date = b->ood_last_cmt_date;
>> > statstruct->ood_kind = b->ood_kind;
>> > - statstruct->ood_last_cmt_author = b->ood_last_cmt_author;
>> > + statstruct->ood_last_cmt_author = apr_pstrdup (pool,
>> > + b->ood_last_cmt_author);
>>
>> ditto
>>
>> > }
>> > return SVN_NO_ERROR;
>> > }
>>
>> --
>> Philip Martin
>
> Hi Philip,
>
> I'm not sure I understand your concern. Is it that apr_pstrdup shouldn't
> be passed a null value?

That was my concern.

> Or is it something that might occur later if
> statstruct->ood_last_cmt_author is set to null? Or something else
> entirely?
>
> On windows at least, if you pass apr_pstrdup null, it just returns null.
> Is this not a safe cross-platform assumption?

The documentation for apr_pstrdup doesn't say that NULL is a valid
input, but it appears that the code accepts it. I don't know whether
that makes it safe or not.

Why does the code have an 'if' check for b->url but not for
b->ood_last_cmt_author?

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Dec 16 22:45:23 2005

This is an archived mail posted to the Subversion Dev mailing list.