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

Re: svn commit: r17225 - in branches/svndiff1: . notes subversion/include subversion/libsvn_delta subversion/libsvn_fs_base subversion/libsvn_fs_base/util subversion/libsvn_ra_svn subversion/libsvn_repos subversion/tests/libsvn_delta

From: Daniel Berlin <dberlin_at_dberlin.org>
Date: 2005-11-07 16:10:54 CET

On Mon, 2005-11-07 at 14:42 +0000, Philip Martin wrote:
> dberlin@tigris.org writes:
>
> > Author: dberlin
> > Date: Sun Nov 6 18:33:49 2005
> > New Revision: 17225
>
> > @@ -165,7 +215,20 @@
> > append_encoded_int (header, window->sview_offset, pool);
> > append_encoded_int (header, window->sview_len, pool);
> > append_encoded_int (header, window->tview_len, pool);
> > + if (err == SVN_NO_ERROR && eb->version == 1)
> > + {
> > + err = zlib_encode (instructions, i1);
> > + instructions = i1;
>
> The error handling looks dodgy. Is instructions = i1 correct if
> zlib_encode returns an error?

Yeah, i forgot to SVN_ERR them, i'll fix it.

>
> > + }
> > append_encoded_int (header, instructions->len, pool);
>
> Is instructions->len valid if zlib_encode returned an error?
>
> > + if (err == SVN_NO_ERROR && eb->version == 1)
> > + {
> > + svn_stringbuf_t *temp;
> > + temp = svn_stringbuf_create_from_string (window->new_data, pool);
> > + err = zlib_encode (temp, newdata);
> > + window->new_data = svn_string_create_from_buf (newdata, pool);
>
> Same again, is newdata valid if zlib_encode returned an error?

Nope.

>
> > + }
> > +
> > append_encoded_int (header, window->new_data->len, pool);
>
> And here. I suppose zlib_encode might provide a guarantee that makes
> these constructs work, but it's not obvious to me.

Nope, we should have returned an error.

>
> Also, if there is an error I think it gets leaked here as the next bit
> of code overwrites err.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Nov 7 16:13:32 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.