Thread (77 messages) 77 messages, 4 authors, 2016-06-15
STALE3758d

[PATCH 01/11] fixup! vcs-svn: Learn to parse variable-length integers

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:49:46
Subsystem: the rest · Maintainer: Linus Torvalds

Report EOF correctly in integer parsing code.

Signed-off-by: Jonathan Nieder <redacted>
---
This patch is meant for squashing.

 vcs-svn/svndiff.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/vcs-svn/svndiff.c b/vcs-svn/svndiff.c
index df0b1a2..36d2b30 100644
--- a/vcs-svn/svndiff.c
+++ b/vcs-svn/svndiff.c
@@ -45,7 +45,8 @@ static int read_int(struct line_buffer *in, uintmax_t *result, off_t *len)
 	while (sz) {
 		int ch = buffer_read_char(in);
 		if (ch == EOF)
-			break;
+			return error("Delta ends early (%"PRIu64" bytes remaining)",
+				     (uint64_t) sz);
 		sz--;
 		rv <<= VLI_BITS_PER_DIGIT;
 		rv += (ch & VLI_DIGIT_MASK);
-- 
1.7.2.3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help