Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Oct 2017 08:03:15 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r324623 - head/usr.sbin/ctld
Message-ID:  <201710150803.v9F83FNO090721@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <nikita.kozlov at blade-group.com>
  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);



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