1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-22 11:17:19 +00:00

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.
This commit is contained in:
Alexander Kabaev 2017-12-23 16:45:24 +00:00
parent 5f943cca65
commit 92f19df431
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=327111

View File

@ -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);