aboutsummaryrefslogtreecommitdiff
path: root/sys/net/if_clone.c
diff options
context:
space:
mode:
authorAlexander Kabaev <kan@FreeBSD.org>2017-12-23 16:45:24 +0000
committerAlexander Kabaev <kan@FreeBSD.org>2017-12-23 16:45:24 +0000
commit92f19df431e2135b6750f26aa7a4523119e3cf89 (patch)
tree475651bf61a4172f8864377a243c8ee7df9182ec /sys/net/if_clone.c
parent5f943cca65ce394da89b66ab503accc3bad98c1e (diff)
downloadsrc-92f19df431e2135b6750f26aa7a4523119e3cf89.tar.gz
src-92f19df431e2135b6750f26aa7a4523119e3cf89.zip
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.
Notes
Notes: svn path=/head/; revision=327111
Diffstat (limited to 'sys/net/if_clone.c')
-rw-r--r--sys/net/if_clone.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/net/if_clone.c b/sys/net/if_clone.c
index 23381267650e..8a227a527d80 100644
--- a/sys/net/if_clone.c
+++ b/sys/net/if_clone.c
@@ -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);