From owner-svn-src-head@freebsd.org Thu Mar 30 04:21:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2520AD25B37; Thu, 30 Mar 2017 04:21:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E941B3A4; Thu, 30 Mar 2017 04:21:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2U4L3hR056272; Thu, 30 Mar 2017 04:21:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U4L39e056271; Thu, 30 Mar 2017 04:21:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201703300421.v2U4L39e056271@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 30 Mar 2017 04:21:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316211 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 04:21:04 -0000 Author: kib Date: Thu Mar 30 04:21:02 2017 New Revision: 316211 URL: https://svnweb.freebsd.org/changeset/base/316211 Log: A followup to r315749, two more places where brand->interp_path was accessed unconditionally. Reported by: se Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Thu Mar 30 02:50:21 2017 (r316210) +++ head/sys/kern/imgact_elf.c Thu Mar 30 04:21:02 2017 (r316211) @@ -291,9 +291,11 @@ __elfN(get_brandinfo)(struct image_param * this, we return first brand which accepted * our note and, optionally, header. */ - if (ret && bi_m == NULL && (strlen(bi->interp_path) + - 1 != interp_name_len || strncmp(interp, - bi->interp_path, interp_name_len) != 0)) { + if (ret && bi_m == NULL && interp != NULL && + (bi->interp_path == NULL || + (strlen(bi->interp_path) + 1 != interp_name_len || + strncmp(interp, bi->interp_path, interp_name_len) + != 0))) { bi_m = bi; ret = 0; } @@ -360,6 +362,7 @@ __elfN(get_brandinfo)(struct image_param != 0) continue; if (hdr->e_machine == bi->machine && + bi->interp_path != NULL && /* ELF image p_filesz includes terminating zero */ strlen(bi->interp_path) + 1 == interp_name_len && strncmp(interp, bi->interp_path, interp_name_len)