svn commit: r327111 - head/sys/net
Alexander Kabaev
kan at FreeBSD.org
Sat Dec 23 16:45:25 UTC 2017
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);
More information about the svn-src-all
mailing list