receive-pack: do not overallocate command structure
commit9c6bda429765eca77beab997d1e5860a22b01082
authorJunio C Hamano <gitster@pobox.com>
Fri, 15 Aug 2014 20:53:46 +0000 (15 13:53 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 22 Aug 2014 22:35:59 +0000 (22 15:35 -0700)
treea27370615d482631499c536e030d87891e12344c
parentaa544bfbc6eb11e4f0471f3144d3e3ac75c0e4a9
receive-pack: do not overallocate command structure

An "update" command in the protocol exchange consists of 40-hex old
object name, SP, 40-hex new object name, SP, and a refname, but the
first instance is further followed by a NUL with feature requests.

The command structure, which has a flex-array member that stores the
refname at the end, was allocated based on the whole length of the
update command, without excluding the trailing feature requests.

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