[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: Philip Martin <philip_at_codematters.co.uk>
Date: 2005-11-07 15:42:40 CET

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?

> + }
> 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?

> + }
> +
> 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.

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

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Nov 7 15:45:35 2005

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