commit | cfeb08a1932f970f8cc8c7b73f86001389a343dd | [log] [tgz] |
---|---|---|
author | Glenn L McGrath <bug1@ihug.co.nz> | Fri Jul 13 17:59:48 2001 +0000 |
committer | Glenn L McGrath <bug1@ihug.co.nz> | Fri Jul 13 17:59:48 2001 +0000 |
tree | 74c183dd9fedd8c2f160b167f0d795e4a35a14e3 | |
parent | 5e66a26eaa30d348341619a365888e54dab3af1e [diff] |
Make sure there is a trailing '\0' when extracting to buffer.
diff --git a/libbb/unarchive.c b/libbb/unarchive.c index 80dddb2..852bd06 100644 --- a/libbb/unarchive.c +++ b/libbb/unarchive.c
@@ -102,6 +102,7 @@ if (S_ISREG(file_entry->mode)) { buffer = (char *) xmalloc(file_entry->size + 1); fread(buffer, 1, file_entry->size, src_stream); + buffer[file_entry->size] = '\0'; archive_offset += file_entry->size; return(buffer); }