diff options
author | emaste <emaste@FreeBSD.org> | 2015-01-07 01:51:02 +0000 |
---|---|---|
committer | emaste <emaste@FreeBSD.org> | 2015-01-07 01:51:02 +0000 |
commit | 8946d00c7f96585265ad380a3743c64d4aac09d9 (patch) | |
tree | a206ae0141244d83ba22b4a833dbdd98227f6993 | |
parent | 2fbe376a24b47f13cf94606470d1b204a3dcf2ad (diff) | |
download | FreeBSD-src-8946d00c7f96585265ad380a3743c64d4aac09d9.zip FreeBSD-src-8946d00c7f96585265ad380a3743c64d4aac09d9.tar.gz |
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
-rw-r--r-- | usr.bin/ar/read.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/ar/read.c b/usr.bin/ar/read.c index e595869..ed7a94a 100644 --- a/usr.bin/ar/read.c +++ b/usr.bin/ar/read.c @@ -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) |