From: Denys Vlasenko Date: Sat, 6 Dec 2014 23:49:55 +0000 (+0100) Subject: make xmalloc_open_zipped_read_close result NUL terminated X-Git-Tag: 1_23_0~12 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=cfcd2399b20998a374ad52a5fac353f77e6ec0f6;p=oweals%2Fbusybox.git make xmalloc_open_zipped_read_close result NUL terminated Compat with xmalloc_open_read_close Signed-off-by: Denys Vlasenko --- diff --git a/archival/libarchive/open_transformer.c b/archival/libarchive/open_transformer.c index 9d762a859..ab6aa3afc 100644 --- a/archival/libarchive/open_transformer.c +++ b/archival/libarchive/open_transformer.c @@ -43,8 +43,9 @@ ssize_t FAST_FUNC transformer_write(transformer_state_t *xstate, const void *buf nwrote = -1; goto ret; } - xstate->mem_output_buf = xrealloc(xstate->mem_output_buf, size); + xstate->mem_output_buf = xrealloc(xstate->mem_output_buf, size + 1); memcpy(xstate->mem_output_buf + pos, buf, bufsize); + xstate->mem_output_buf[size] = '\0'; nwrote = bufsize; } else { nwrote = full_write(xstate->dst_fd, buf, bufsize);