Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Dec 2017 16:45:24 +0000 (UTC)
From:      Alexander Kabaev <kan@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r327111 - head/sys/net
Message-ID:  <201712231645.vBNGjOYh064096@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kan
Date: Sat Dec 23 16:45:24 2017
New Revision: 327111
URL: https://svnweb.freebsd.org/changeset/base/327111

Log:
  Do not pass NULL pointer to copyout in if_clone_list.
  
  Sometimes caller is only interested in how many clones
  are there and NULL pointer is passed for the destination
  buffer. Do not pass it to copyout then.

Modified:
  head/sys/net/if_clone.c

Modified: head/sys/net/if_clone.c
==============================================================================
--- head/sys/net/if_clone.c	Sat Dec 23 16:24:02 2017	(r327110)
+++ head/sys/net/if_clone.c	Sat Dec 23 16:45:24 2017	(r327111)
@@ -508,7 +508,7 @@ if_clone_list(struct if_clonereq *ifcr)
 
 done:
 	IF_CLONERS_UNLOCK();
-	if (err == 0)
+	if (err == 0 && dst != NULL)
 		err = copyout(outbuf, dst, buf_count*IFNAMSIZ);
 	if (outbuf != NULL)
 		free(outbuf, M_CLONE);



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