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