Add a nulterm byte to the returned sysctl string.

PR:		195668
This commit is contained in:
ian 2015-03-15 00:39:18 +00:00
parent cb2eadc65f
commit e497716fbd

View File

@ -1009,7 +1009,7 @@ sysctl_kern_msgbuf(SYSCTL_HANDLER_ARGS)
len = msgbuf_peekbytes(msgbufp, buf, sizeof(buf), &seq);
mtx_unlock(&msgbuf_lock);
if (len == 0)
return (0);
return (SYSCTL_OUT(req, "", 1)); /* add nulterm */
error = sysctl_handle_opaque(oidp, buf, len, req);
if (error)