From: Randall S. Becker Date: Fri, 19 Jun 2020 20:23:19 +0000 (-0400) Subject: bugreport.c: replace strbuf_write_fd with write_in_full X-Git-Tag: v2.28.0-rc0~32^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f64b6a1f750e65ca90435f714d9350493aad836d;p=thirdparty%2Fgit.git 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 Signed-off-by: Junio C Hamano --- 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); /*