busybox/busybox.libunarchive-array.patch

42 lines
1.8 KiB
Diff

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(-)
Index: busybox-1.4.2/archival/libunarchive/get_header_tar.c
===================================================================
--- busybox-1.4.2.orig/archival/libunarchive/get_header_tar.c
+++ busybox-1.4.2/archival/libunarchive/get_header_tar.c
@@ -136,8 +136,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? */
@@ -151,11 +151,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);