Author: danielsh
Date: Tue Aug 4 10:49:08 2015
New Revision: 1694028
URL: http://svn.apache.org/r1694028
Log:
On the patch-exec branch, fix an uninitialized variable.
The compiler didn't complain; this was found through the next revision.
Setting 'original_length' to '1' causes a segfault, so presumably that member
was initialized to 0 by coincidence (although nothing promised that value).
* subversion/libsvn_diff/parse-diff.c
(svn_diff_hunk__create_adds_single_line): Initialize all 'hunk' members.
Modified:
subversion/branches/patch-exec/subversion/libsvn_diff/parse-diff.c
Modified: subversion/branches/patch-exec/subversion/libsvn_diff/parse-diff.c
URL:
http://svn.apache.org/viewvc/subversion/branches/patch-exec/subversion/libsvn_diff/parse-diff.c?rev=1694028&r1=1694027&r2=1694028&view=diff
==============================================================================
--- subversion/branches/patch-exec/subversion/libsvn_diff/parse-diff.c
(original)
+++ subversion/branches/patch-exec/subversion/libsvn_diff/parse-diff.c Tue Aug
4 10:49:08 2015
@@ -110,6 +110,12 @@ svn_diff_hunk__create_adds_single_line(s
hunk->original_text_range.current = 0;
hunk->original_text_range.end = 0;
+ hunk->original_start = 0;
+ hunk->original_length = 0;
+
+ hunk->modified_start = 1;
+ hunk->modified_length = 1;
+
hunk->modified_text_range.start = STRLEN_LITERAL(hunk_header);
hunk->modified_text_range.current = STRLEN_LITERAL(hunk_header);
hunk->modified_text_range.end = end;