Browse Source

Names end before the first NULL (not the last)

This fixes parsing of archives produced on macOS.

Signed-off-by: Keith W. Campbell <keithc@ca.ibm.com>
master
Keith W. Campbell 2 years ago
parent
commit
048df1e3cf
No known key found for this signature in database GPG Key ID: 35CA56608D92860D
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      src/main/org/apache/tools/tar/TarUtils.java

+ 3
- 3
src/main/org/apache/tools/tar/TarUtils.java View File

@@ -286,9 +286,9 @@ public class TarUtils {
final ZipEncoding encoding)
throws IOException {

int len = length;
for (; len > 0; len--) {
if (buffer[offset + len - 1] != 0) {
int len = 0;
for (; len < length; ++len) {
if (buffer[offset + len] == 0) {
break;
}
}


Loading…
Cancel
Save