OSDN Git Service

receive-pack: do not overstep command line argument array
authorJunio C Hamano <gitster@pobox.com>
Mon, 8 Aug 2011 19:31:01 +0000 (12:31 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 8 Aug 2011 19:31:01 +0000 (12:31 -0700)
Previous commit added one element to the command line, without
making sure the result fits there.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/receive-pack.c

index fca26fb..0d51bfb 100644 (file)
@@ -651,7 +651,7 @@ static const char *unpack(int quiet)
 
        if (ntohl(hdr.hdr_entries) < unpack_limit) {
                int code, i = 0;
-               const char *unpacker[4];
+               const char *unpacker[5];
                unpacker[i++] = "unpack-objects";
                if (quiet)
                        unpacker[i++] = "-q";