SHA256
1
0
forked from pool/busybox
busybox/busybox.libunarchive-array.patch

40 lines
1.6 KiB
Diff
Raw Normal View History

archival/libunarchive/get_header_tar.c: In function 'get_header_tar':
archival/libunarchive/get_header_tar.c:140: warning: array subscript is above array bounds
archival/libunarchive/get_header_tar.c:155: warning: array subscript is above array bounds
archival/libunarchive/get_header_tar.c:158: warning: array subscript is above array bounds
make[1]: *** [archival/libunarchive/get_header_tar.o] Error 1
---
archival/libunarchive/get_header_tar.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
--- a/archival/libunarchive/get_header_tar.c
+++ b/archival/libunarchive/get_header_tar.c
@@ -143,8 +143,8 @@ char get_header_tar(archive_handle_t *ar
}
file_header->link_name = NULL;
if (!linkname && parse_names && tar.linkname[0]) {
- /* we trash magic[0] here, it's ok */
- tar.linkname[sizeof(tar.linkname)] = '\0';
+ /* we trash magic[0] here to terminate tar.linkname, it's ok */
+ tar.magic[0] = '\0';
file_header->link_name = xstrdup(tar.linkname);
/* FIXME: what if we have non-link object with link_name? */
/* Will link_name be free()ed? */
@@ -158,11 +158,11 @@ char get_header_tar(archive_handle_t *ar
file_header->name = NULL;
if (!longname && parse_names) {
- /* we trash mode[0] here, it's ok */
- tar.name[sizeof(tar.name)] = '\0';
+ /* we trash mode[0] here to terminate tar.name, it's ok */
+ tar.mode[0] = '\0';
if (tar.prefix[0]) {
- /* and padding[0] */
- tar.prefix[sizeof(tar.prefix)] = '\0';
+ /* and padding[0] to terminate tar.prefix */
+ tar.padding[0] = '\0';
file_header->name = concat_path_file(tar.prefix, tar.name);
} else
file_header->name = xstrdup(tar.name);