1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-20 07:36:09 +02:00

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>
This commit is contained in:
Randall S. Becker 2020-06-19 16:23:19 -04:00 committed by Junio C Hamano
parent 01b62aaf11
commit f64b6a1f75

View File

@ -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);
/*