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:
Ed Maste 2015-05-21 13:30:10 +00:00
parent e8319c522f
commit 6a0493a4d2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/stable/10/; revision=283234

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)