author | Jeff King <peff@peff.net> | |
Thu, 8 Dec 2011 08:43:19 +0000 (03:43 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 10 Dec 2011 07:17:00 +0000 (23:17 -0800) | ||
commit | 5914f2d057c259668695bccab8e9bec3a4bead53 | |
tree | 998cf2587a2906b486905d101826723ac2a476b0 | tree | snapshot |
parent | 69d61daec7a7915f6a664f32002fd9403e7f2a34 | commit | diff |
fetch: create status table using strbuf
When we fetch from a remote, we print a status table like:
From url
* [new branch] foo -> origin/foo
We create this table in a static buffer using sprintf. If
the remote refnames are long, they can overflow this buffer
and smash the stack.
Instead, let's use a strbuf to build the string.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
When we fetch from a remote, we print a status table like:
From url
* [new branch] foo -> origin/foo
We create this table in a static buffer using sprintf. If
the remote refnames are long, they can overflow this buffer
and smash the stack.
Instead, let's use a strbuf to build the string.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fetch.c | diff | blob | history |