Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Jan 2015 01:51:02 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r276774 - head/usr.bin/ar
Message-ID:  <201501070151.t071p2qM069156@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Wed Jan  7 01:51:02 2015
New Revision: 276774
URL: https://svnweb.freebsd.org/changeset/base/276774

Log:
  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

Modified:
  head/usr.bin/ar/read.c

Modified: head/usr.bin/ar/read.c
==============================================================================
--- head/usr.bin/ar/read.c	Wed Jan  7 01:41:45 2015	(r276773)
+++ head/usr.bin/ar/read.c	Wed Jan  7 01:51:02 2015	(r276774)
@@ -102,7 +102,8 @@ read_archive(struct bsdar *bsdar, char m
 			continue;
 		}
 
-		name = archive_entry_pathname(entry);
+		if ((name = archive_entry_pathname(entry)) == NULL)
+			break;
 
 		/* Skip pseudo members. */
 		if (strcmp(name, "/") == 0 || strcmp(name, "//") == 0)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501070151.t071p2qM069156>