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

23 lines
1014 B
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 | 3 +++
1 file changed, 3 insertions(+)
--- a/archival/libunarchive/get_header_tar.c
+++ b/archival/libunarchive/get_header_tar.c
@@ -225,6 +225,9 @@ char FAST_FUNC get_header_tar(archive_ha
}
file_header->link_target = NULL;
if (!p_linkname && parse_names && tar.linkname[0]) {
+ /* we trash magic[0] here to terminate tar.linkname, it's ok */
+ tar.magic[0] = '\0';
+
file_header->link_target = xstrndup(tar.linkname, sizeof(tar.linkname));
/* FIXME: what if we have non-link object with link_target? */
/* Will link_target be free()ed? */