MFC r276774: ar: Avoid null pointer deref while reading corrupt archives

ELF Tool Chain ticket #467

Reported by:	Alexander Cherepanov <cherepan@mccme.ru>
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
emaste 2015-05-21 13:30:10 +00:00
parent 9a9f3ecf67
commit 0895f35cb3

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)