diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2014-12-07 00:49:55 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2014-12-07 00:49:55 +0100 |
commit | cfcd2399b20998a374ad52a5fac353f77e6ec0f6 (patch) | |
tree | 97f02e7fb42a1c346e9a3d1a22cf12fc77321118 | |
parent | b4c11c139717729b8257ee9382d4e5ed713d4dde (diff) | |
download | busybox-w32-cfcd2399b20998a374ad52a5fac353f77e6ec0f6.tar.gz busybox-w32-cfcd2399b20998a374ad52a5fac353f77e6ec0f6.tar.bz2 busybox-w32-cfcd2399b20998a374ad52a5fac353f77e6ec0f6.zip |
make xmalloc_open_zipped_read_close result NUL terminated
Compat with xmalloc_open_read_close
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | archival/libarchive/open_transformer.c | 3 |
1 files changed, 2 insertions, 1 deletions
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 | |||
43 | nwrote = -1; | 43 | nwrote = -1; |
44 | goto ret; | 44 | goto ret; |
45 | } | 45 | } |
46 | xstate->mem_output_buf = xrealloc(xstate->mem_output_buf, size); | 46 | xstate->mem_output_buf = xrealloc(xstate->mem_output_buf, size + 1); |
47 | memcpy(xstate->mem_output_buf + pos, buf, bufsize); | 47 | memcpy(xstate->mem_output_buf + pos, buf, bufsize); |
48 | xstate->mem_output_buf[size] = '\0'; | ||
48 | nwrote = bufsize; | 49 | nwrote = bufsize; |
49 | } else { | 50 | } else { |
50 | nwrote = full_write(xstate->dst_fd, buf, bufsize); | 51 | nwrote = full_write(xstate->dst_fd, buf, bufsize); |