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:
authorRandall S. Becker <randall.becker@nexbridge.ca>2020-06-19 23:23:19 +0300
committerJunio C Hamano <gitster@pobox.com>2020-06-19 23:50:25 +0300
commitf64b6a1f750e65ca90435f714d9350493aad836d (patch)
tree5bc7af71247250e2ed8400e8b21cceb3a9bc76d1 /bugreport.c
parent01b62aaf11a0cbaa1ddce8a9e2b9940985a103af (diff)
bugreport.c: replace strbuf_write_fd with write_in_full
The strbuf_write_fd method did not provide checks for buffers larger than MAX_IO_SIZE. Replacing with write_in_full ensures the entire buffer will always be written to disk or report an error and die. Signed-off-by: Randall S. Becker <rsbecker@nexbridge.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'bugreport.c')
-rw-r--r--bugreport.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/bugreport.c b/bugreport.c
index acacca8fef..0cc71dcc6f 100644
--- a/bugreport.c
+++ b/bugreport.c
@@ -122,7 +122,9 @@ int cmd_main(int argc, const char **argv)
die(_("couldn't create a new file at '%s'"), report_path.buf);
}
- strbuf_write_fd(&buffer, report);
+ if (write_in_full(report, buffer.buf, buffer.len) < 0)
+ die_errno(_("unable to write to %s"), report_path.buf);
+
close(report);
/*