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

Re: svn commit: r1201002 - /subversion/trunk/subversion/libsvn_diff/diff_file.c

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Sun, 13 Nov 2011 15:43:31 +0200

On Friday, November 11, 2011 6:07 PM, philip_at_apache.org wrote:
> Author: philip
> Date: Fri Nov 11 18:07:52 2011
> New Revision: 1201002
>
> URL: http://svn.apache.org/viewvc?rev=1201002&view=rev
> Log:
> Fix an unitialised memory read identified by valgrind. This occurs
> during merge_tests.py 35.
>
> * subversion/libsvn_diff/diff_file.c
> (find_identical_prefix): Don't look beyond endp.
>
> Modified:
> subversion/trunk/subversion/libsvn_diff/diff_file.c
>
> Modified: subversion/trunk/subversion/libsvn_diff/diff_file.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_diff/diff_file.c?rev=1201002&r1=1201001&r2=1201002&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_diff/diff_file.c (original)
> +++ subversion/trunk/subversion/libsvn_diff/diff_file.c Fri Nov 11 18:07:52 2011
> @@ -470,8 +470,9 @@ find_identical_prefix(svn_boolean_t *rea
> too many for the \r. */
> svn_boolean_t ended_at_nonmatching_newline = FALSE;
> for (i = 0; i < file_len; i++)
> - ended_at_nonmatching_newline = ended_at_nonmatching_newline
> - || *file[i].curp == '\n';
> + if (file[i].curp < file[i].endp)
> + ended_at_nonmatching_newline = ended_at_nonmatching_newline
> + || *file[i].curp == '\n';

Does the comment saying:

       * Determine how far we may advance with chunky ops without reaching
       * endp for any of the files.

needs to be updated? (s/reaching/exceeding/)

> if (ended_at_nonmatching_newline)
> {
> lines--;
>
>
>
Received on 2011-11-13 14:44:04 CET

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.