From owner-svn-src-all@freebsd.org Sun Oct 15 08:03:16 2017 Return-Path: Delivered-To: svn-src-all@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 14C90E3D314; Sun, 15 Oct 2017 08:03:16 +0000 (UTC) (envelope-from bapt@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 D624F6E93B; Sun, 15 Oct 2017 08:03:15 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9F83FpA090722; Sun, 15 Oct 2017 08:03:15 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9F83FNO090721; Sun, 15 Oct 2017 08:03:15 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201710150803.v9F83FNO090721@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 15 Oct 2017 08:03:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324623 - head/usr.sbin/ctld X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/usr.sbin/ctld X-SVN-Commit-Revision: 324623 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.23 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: Sun, 15 Oct 2017 08:03:16 -0000 Author: bapt Date: Sun Oct 15 08:03:14 2017 New Revision: 324623 URL: https://svnweb.freebsd.org/changeset/base/324623 Log: Fix ctld segfaulting when using ucl conf file format and having duplicated lun or target Submitted by: Nikita Kozlov MFC after: 3 days Sponsored by: blade Differential Revision: https://reviews.freebsd.org/D12646 Modified: head/usr.sbin/ctld/uclparse.c Modified: head/usr.sbin/ctld/uclparse.c ============================================================================== --- head/usr.sbin/ctld/uclparse.c Sun Oct 15 02:40:13 2017 (r324622) +++ head/usr.sbin/ctld/uclparse.c Sun Oct 15 08:03:14 2017 (r324623) @@ -619,6 +619,8 @@ uclparse_target(const char *name, const ucl_object_t * const char *key; target = target_new(conf, name); + if (target == NULL) + return (1); while ((obj = ucl_iterate_object(top, &it, true))) { key = ucl_object_key(obj); @@ -807,6 +809,8 @@ uclparse_lun(const char *name, const ucl_object_t *top const char *key; lun = lun_new(conf, name); + if (lun == NULL) + return (1); while ((obj = ucl_iterate_object(top, &it, true))) { key = ucl_object_key(obj);