From owner-svn-src-all@freebsd.org Wed Oct 18 08:18:02 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 89289E2FE84; Wed, 18 Oct 2017 08:18:02 +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 56CAA6FF73; Wed, 18 Oct 2017 08:18:02 +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 v9I8I1uG022688; Wed, 18 Oct 2017 08:18:01 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9I8I1Be022687; Wed, 18 Oct 2017 08:18:01 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201710180818.v9I8I1Be022687@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 18 Oct 2017 08:18:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324720 - stable/11/usr.sbin/ctld X-SVN-Group: stable-11 X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: stable/11/usr.sbin/ctld X-SVN-Commit-Revision: 324720 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: Wed, 18 Oct 2017 08:18:02 -0000 Author: bapt Date: Wed Oct 18 08:18:01 2017 New Revision: 324720 URL: https://svnweb.freebsd.org/changeset/base/324720 Log: MFC r324623: Fix ctld segfaulting when using ucl conf file format and having duplicated lun or target Submitted by: Nikita Kozlov Sponsored by: blade Differential Revision: https://reviews.freebsd.org/D12646 Modified: stable/11/usr.sbin/ctld/uclparse.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/ctld/uclparse.c ============================================================================== --- stable/11/usr.sbin/ctld/uclparse.c Wed Oct 18 08:06:05 2017 (r324719) +++ stable/11/usr.sbin/ctld/uclparse.c Wed Oct 18 08:18:01 2017 (r324720) @@ -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);