diff options
author | Jeff King <peff@peff.net> | 2018-05-19 03:56:37 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-05-21 02:54:30 +0200 |
commit | 390c6cbc5e643b6d89869b319b51b5b62a3f5a09 (patch) | |
tree | 76314ecfefce389a63c4950b731d4ada8325d28f /http.h | |
parent | Git 2.17 (diff) | |
download | git-390c6cbc5e643b6d89869b319b51b5b62a3f5a09.tar.xz git-390c6cbc5e643b6d89869b319b51b5b62a3f5a09.zip |
http: use strbufs instead of fixed buffers
We keep the names of incoming packs and objects in fixed
PATH_MAX-size buffers, and snprintf() into them. This is
unlikely to end up with truncated filenames, but it is
possible (especially on systems where PATH_MAX is shorter
than actual paths can be). Let's switch to using strbufs,
which makes the question go away entirely.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'http.h')
-rw-r--r-- | http.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -200,7 +200,7 @@ struct http_pack_request { struct packed_git *target; struct packed_git **lst; FILE *packfile; - char tmpfile[PATH_MAX]; + struct strbuf tmpfile; struct active_request_slot *slot; }; @@ -212,7 +212,7 @@ extern void release_http_pack_request(struct http_pack_request *preq); /* Helpers for fetching object */ struct http_object_request { char *url; - char tmpfile[PATH_MAX]; + struct strbuf tmpfile; int localfile; CURLcode curl_result; char errorstr[CURL_ERROR_SIZE]; |