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);
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to