From: Junio C Hamano Date: Mon, 04 Jun 2018 04:31:58 GMT Subject: Re: [PATCH v7 2/2] http-backend: respect CONTENT_LENGTH for receive-pack Message-ID: In-Reply-To: <20180602212749.21324-3-max@max630.net> Max Kirillov writes: > +static void pipe_fixed_length(const char *prog_name, int out, size_t req_len) > +{ > + unsigned char buf[8192]; > + size_t remaining_len = req_len; > + > + while (remaining_len > 0) { > + size_t chunk_length = remaining_len > sizeof(buf) ? sizeof(buf) : remaining_len; > + size_t n = xread(0, buf, chunk_length); > + if (n < 0) > + die_errno("Reading request failed"); n that is of type size_t is unsigned and cannot be negative here.