summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ec71aa2)
raw | patch | inline | side by side (parent: ec71aa2)
author | Jonathan Nieder <jrnieder@gmail.com> | |
Wed, 13 Oct 2010 09:48:07 +0000 (04:48 -0500) | ||
committer | Jonathan Nieder <jrnieder@gmail.com> | |
Mon, 28 Mar 2011 04:28:02 +0000 (23:28 -0500) |
By constraining the format of deltas, we can more easily detect
corruption and other breakage.
Requiring deltas not to provide unconsumed data also opens the
possibility of ignoring the declared amount of novel data and simply
streaming the data as needed to fulfill copyfrom_data requests.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Ramkumar Ramachandra <artagnon@gmail.com>
corruption and other breakage.
Requiring deltas not to provide unconsumed data also opens the
possibility of ignoring the declared amount of novel data and simply
streaming the data as needed to fulfill copyfrom_data requests.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Ramkumar Ramachandra <artagnon@gmail.com>
t/t9011-svn-da.sh | patch | blob | history | |
vcs-svn/svndiff.c | patch | blob | history |
diff --git a/t/t9011-svn-da.sh b/t/t9011-svn-da.sh
index ba8ce052aa05606290d8b23c101c9e0dacc9d318..72691b9379b623ad999030a1c401992a1d6a8cb9 100755 (executable)
--- a/t/t9011-svn-da.sh
+++ b/t/t9011-svn-da.sh
test_must_fail test-svn-fe -d preimage clear.longread 9
'
-test_expect_success 'inline data' '
+test_expect_success 'forbid unconsumed inline data' '
printf "SVNQ%b%s%b%s" "QQQQ\003" "bar" "QQQQ\001" "x" |
q_to_nul >inline.clear &&
- test-svn-fe -d preimage inline.clear 18 >actual &&
- test_cmp empty actual
+ test_must_fail test-svn-fe -d preimage inline.clear 18 >actual
'
test_expect_success 'reject truncated inline data' '
diff --git a/vcs-svn/svndiff.c b/vcs-svn/svndiff.c
index ed1d4a08be83b2255fb967b628d24483ba782a5c..fb7dc22f92d763382e952debcc2196d35cbf2b67 100644 (file)
--- a/vcs-svn/svndiff.c
+++ b/vcs-svn/svndiff.c
)
if (execute_one_instruction(ctx, &instructions, &data_pos))
return -1;
+ if (data_pos != ctx->data.len)
+ return error("invalid delta: does not copy all inline data");
return 0;
}