From owner-svn-src-all@freebsd.org Mon Apr 16 07:26:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 912DCF9098D; Mon, 16 Apr 2018 07:26:24 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 453FD737D0; Mon, 16 Apr 2018 07:26:24 +0000 (UTC) (envelope-from tsoome@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3BA051A454; Mon, 16 Apr 2018 07:26:24 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3G7QOJ7026330; Mon, 16 Apr 2018 07:26:24 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3G7QOoi026329; Mon, 16 Apr 2018 07:26:24 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201804160726.w3G7QOoi026329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Mon, 16 Apr 2018 07:26:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332555 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 332555 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2018 07:26:24 -0000 Author: tsoome Date: Mon Apr 16 07:26:23 2018 New Revision: 332555 URL: https://svnweb.freebsd.org/changeset/base/332555 Log: loader: provide values in help_getnext() With r328289 we attempt to make sure we free the resources allocated in help_getnext(), however, it is possible that we get no resources allocated and help_getnext() will return early. Make sure we have pointers set to NULL early in help_getnext(). Reported by: Andy Fiddaman Modified: head/stand/common/commands.c Modified: head/stand/common/commands.c ============================================================================== --- head/stand/common/commands.c Mon Apr 16 04:16:46 2018 (r332554) +++ head/stand/common/commands.c Mon Apr 16 07:26:23 2018 (r332555) @@ -64,7 +64,9 @@ static int help_getnext(int fd, char **topic, char **subtopic, char **desc) { char line[81], *cp, *ep; - + + /* Make sure we provide sane values. */ + *topic = *subtopic = *desc = NULL; for (;;) { if (fgetstr(line, 80, fd) < 0) return(0);