Thread (39 messages) flat view 39 messages, 3 authors, 2016-06-15

Re: [PATCHv2 04/10] pkt-line: change error message for oversized packet

From: Jeff King <hidden>
Date: 2016-06-15 22:56:11

On Mon, Feb 18, 2013 at 02:15:23AM -0800, Jonathan Nieder wrote:
Jeff King wrote:
quoted
--- a/pkt-line.c
+++ b/pkt-line.c
@@ -160,7 +160,8 @@ static int packet_read_internal(int fd, char *buffer, unsigned size, int gently)
 	}
 	len -= 4;
 	if (len >= size)
-		die("protocol error: bad line length %d", len);
+		die("protocol error: line too large: (expected %u, got %d)",
+		    size, len);
Makes sense.  I think this should say "expected < %u, got %d", since we
don't actually expect most lines to be 1004 bytes in practice.
Yeah, I had toyed with writing "expected max %u" for the same reason.
I'll tweak it in the re-roll.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help