run_external_diff: use an argv_array for the command line
commit82fbf269b9994d172719b2d456db5ef8453b323d
authorJeff King <peff@peff.net>
Sat, 19 Apr 2014 19:17:06 +0000 (19 15:17 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 21 Apr 2014 17:29:50 +0000 (21 10:29 -0700)
tree3cad5b6db3b1884b1de56661d8ef447d80ec1640
parent0bc85abb7aa9b24b093253018801a0fb43d01122
run_external_diff: use an argv_array for the command line

We currently generate the command-line for the external
command using a fixed-length array of size 10. But if there
is a rename, we actually need 11 elements (10 items, plus a
NULL), and end up writing a random NULL onto the stack.

Rather than bump the limit, let's just use an argv_array, which
makes this sort of error impossible.

Noticed-by: Max L <infthi.inbox@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff.c