Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2017-09-05 15:14:23 +0300
committerJunio C Hamano <gitster@pobox.com>2017-09-06 11:19:52 +0300
commitd88ef6605120fd75be38376ba147623cf427bf73 (patch)
tree921faad50f4f5757c10f8d0b6e6ff4359f659b94 /gpg-interface.c
parentc0e963b77c6892d40d4ca81a71098aaa6c4eaed3 (diff)
verify_signed_buffer: prefer close_tempfile() to close()
We do a manual close() on the descriptor provided to us by mks_tempfile. But this runs contrary to the advice in tempfile.h, which notes that you should always use close_tempfile(). Otherwise the descriptor may be reused without the tempfile object knowing it, and the later call to delete_tempfile() could close a random descriptor. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gpg-interface.c')
-rw-r--r--gpg-interface.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gpg-interface.c b/gpg-interface.c
index d936f3a32f..455b6c04b4 100644
--- a/gpg-interface.c
+++ b/gpg-interface.c
@@ -215,7 +215,7 @@ int verify_signed_buffer(const char *payload, size_t payload_size,
delete_tempfile(&temp);
return -1;
}
- close(fd);
+ close_tempfile(&temp);
argv_array_pushl(&gpg.args,
gpg_program,