On Friday, November 11, 2011 6:07 PM, phi...@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--; > > >