ar: Avoid null pointer deref while reading corrupt archives

ELF Tool Chain ticket #467

Reported by:	Alexander Cherepanov <cherepan@mccme.ru>
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Ed Maste 2015-01-07 01:51:02 +00:00
parent d5edbbc623
commit 63bf16a1c4

View File

@ -102,7 +102,8 @@ read_archive(struct bsdar *bsdar, char mode)
continue;
}
name = archive_entry_pathname(entry);
if ((name = archive_entry_pathname(entry)) == NULL)
break;
/* Skip pseudo members. */
if (strcmp(name, "/") == 0 || strcmp(name, "//") == 0)