Nullterminate strings returned via sysctl.
PR: 195668
This commit is contained in:
parent
0b9b8739c0
commit
9bc58e3d33
@ -321,6 +321,7 @@ sysctl_l2t(SYSCTL_HANDLER_ARGS)
|
||||
mtx_unlock(&e->lock);
|
||||
}
|
||||
|
||||
sbuf_putc(&sb, 0); /* nullterm */
|
||||
rc = sbuf_finish(sb);
|
||||
sbuf_delete(sb);
|
||||
|
||||
|
@ -5090,6 +5090,7 @@ sysctl_int_array(SYSCTL_HANDLER_ARGS)
|
||||
for (i = arg1; arg2; arg2 -= sizeof(int), i++)
|
||||
sbuf_printf(&sb, "%d ", *i);
|
||||
sbuf_trim(&sb);
|
||||
sbuf_putc(&sb, 0); /* nullterm */
|
||||
sbuf_finish(&sb);
|
||||
rc = sysctl_handle_string(oidp, sbuf_data(&sb), sbuf_len(&sb), req);
|
||||
sbuf_delete(&sb);
|
||||
|
Loading…
Reference in New Issue
Block a user