Bugs in the rar and cab readers lead to returning entries
with empty filenames. Make bsdtar resistant to this.
Of course, we should also fix the rar and cab
readers to handle these cases correctly and either
return correctly-populated entries or fail cleanly.
}
if (r == ARCHIVE_FATAL)
break;
+ const char *p = archive_entry_pathname(entry);
+ if (p == NULL || p[0] == '\0') {
+ lafe_warnc(0, "Archive entry has empty or unreadable filename ... skipping.");
+ bsdtar->return_value = 1;
+ continue;
+ }
if (bsdtar->uid >= 0) {
archive_entry_set_uid(entry, bsdtar->uid);