Commit 241d838f4878c251290291be1fb847cc6c6cbd03

Edward Thomson 2022-02-27T10:02:05

http: skip processing when body is null or 0 length Mistakenly `&&` when we should have `||`d.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/libgit2/transports/httpclient.c b/src/libgit2/transports/httpclient.c
index 75782da..f07923e 100644
--- a/src/libgit2/transports/httpclient.c
+++ b/src/libgit2/transports/httpclient.c
@@ -395,7 +395,7 @@ static int on_body(http_parser *parser, const char *buf, size_t len)
 	size_t max_len;
 
 	/* Saw data when we expected not to (eg, in consume_response_body) */
-	if (ctx->output_buf == NULL && ctx->output_size == 0) {
+	if (ctx->output_buf == NULL || ctx->output_size == 0) {
 		ctx->parse_status = PARSE_STATUS_NO_OUTPUT;
 		return 0;
 	}