summaryrefslogtreecommitdiff
path: root/vcs-svn/svndiff.c
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2010-10-13 09:48:07 (GMT)
committerJonathan Nieder <jrnieder@gmail.com>2011-03-28 04:28:02 (GMT)
commit4c9b93ed7644a7a7c72bdd8105d88a9ebb8e3e74 (patch)
tree8f093101e2a800437287384876cef5335929eafc /vcs-svn/svndiff.c
parentec71aa2e1f229b90092e6678ac7c2dca3d15b5f3 (diff)
downloadgit-4c9b93ed7644a7a7c72bdd8105d88a9ebb8e3e74.zip
git-4c9b93ed7644a7a7c72bdd8105d88a9ebb8e3e74.tar.gz
git-4c9b93ed7644a7a7c72bdd8105d88a9ebb8e3e74.tar.bz2
vcs-svn: verify that deltas consume all inline data
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>
Diffstat (limited to 'vcs-svn/svndiff.c')
-rw-r--r--vcs-svn/svndiff.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/vcs-svn/svndiff.c b/vcs-svn/svndiff.c
index ed1d4a0..fb7dc22 100644
--- a/vcs-svn/svndiff.c
+++ b/vcs-svn/svndiff.c
@@ -208,6 +208,8 @@ static int apply_window_in_core(struct window *ctx)
)
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;
}