From 150f75467cdd6eaf581d22175bb377399c62893a Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Thu, 2 Feb 2012 05:03:16 -0600 Subject: vcs-svn: allow import of > 4GiB files There is no reason in principle that an svn-format dump would not be able to represent a file whose length does not fit in a 32-bit integer. Use off_t consistently to represent file lengths (in place of using uint32_t in some contexts) so we can handle that. Most svn-fe code is already ready to do that without this patch and passes values of type off_t around. The type mismatch from stragglers was noticed with gcc -Wtype-limits. While at it, tighten the parsing of the Text-content-length field to make sure it is a number and does not overflow, and tighten other overflow checks as that value is passed around and manipulated. Inspired-by: Ramsay Jones Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- vcs-svn/fast_export.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'vcs-svn/fast_export.h') diff --git a/vcs-svn/fast_export.h b/vcs-svn/fast_export.h index 43d05b65ef..aa629f54ff 100644 --- a/vcs-svn/fast_export.h +++ b/vcs-svn/fast_export.h @@ -14,10 +14,10 @@ void fast_export_begin_commit(uint32_t revision, const char *author, const struct strbuf *log, const char *uuid, const char *url, unsigned long timestamp); void fast_export_end_commit(uint32_t revision); -void fast_export_data(uint32_t mode, uint32_t len, struct line_buffer *input); +void fast_export_data(uint32_t mode, off_t len, struct line_buffer *input); void fast_export_blob_delta(uint32_t mode, uint32_t old_mode, const char *old_data, - uint32_t len, struct line_buffer *input); + off_t len, struct line_buffer *input); /* If there is no such file at that rev, returns -1, errno == ENOENT. */ int fast_export_ls_rev(uint32_t rev, const char *path, -- cgit v1.2.3