mirror of
https://github.com/ckolivas/lrzip.git
synced 2026-01-04 07:29:56 +01:00
Allocate slightly more so we can cope when the buffer overflows and fall back to a real temporary file.
This commit is contained in:
parent
37009e2ac5
commit
aeefba2190
6
lrzip.c
6
lrzip.c
|
|
@ -348,8 +348,10 @@ void read_tmpinfile(rzip_control *control, int fd_in)
|
|||
static void open_tmpoutbuf(rzip_control *control)
|
||||
{
|
||||
control->flags |= FLAG_TMP_OUTBUF;
|
||||
control->out_maxlen = control->maxram + control->page_size;
|
||||
control->tmp_outbuf = malloc(control->out_maxlen);
|
||||
control->out_maxlen = control->maxram;
|
||||
/* Allocate slightly more so we can cope when the buffer overflows and
|
||||
* fall back to a real temporary file */
|
||||
control->tmp_outbuf = malloc(control->out_maxlen + control->page_size);
|
||||
if (unlikely(!control->tmp_outbuf))
|
||||
fatal("Failed to malloc tmp_outbuf in open_tmpoutbuf\n");
|
||||
if (!DECOMPRESS && !TEST_ONLY)
|
||||
|
|
|
|||
Loading…
Reference in a new issue