From: Jeff King Date: Mon, 23 Mar 2015 03:53:52 +0000 (-0400) Subject: wt-status: use capture_command X-Git-Tag: v2.4.0-rc0~6^2~3 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/5c950e9bf098b17bb37e06f7c9f50d24e9d2904f?ds=inline;hp=5c950e9bf098b17bb37e06f7c9f50d24e9d2904f wt-status: use capture_command When we spawn "git submodule status" to read its output, we use run_command() followed by strbuf_read() read from the pipe. This can deadlock if the subprocess output is larger than the system pipe buffer. Furthermore, if start_command() fails, we'll try to read from a bogus descriptor (probably "-1" or a descriptor we just closed, but it is a bad idea for us to make assumptions about how start_command implements its error handling). And if start_command succeeds, we leak the file descriptor for the pipe to the child. All of these can be solved by using the capture_command helper. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano ---