mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-02 22:54:52 +00:00
libvmmapi: Zero out the structure passed to VM_GET_MEMSEG
Avoid assuming that the kernel zeros the name buffer, it does not do this for zero-length segments. MFC after: 2 weeks Sponsored by: Innovate UK
This commit is contained in:
parent
1855002ddf
commit
e499fdcb66
|
@ -371,6 +371,7 @@ vm_get_memseg(struct vmctx *ctx, int segid, size_t *lenp, char *namebuf,
|
|||
size_t n;
|
||||
int error;
|
||||
|
||||
bzero(&memseg, sizeof(memseg));
|
||||
memseg.segid = segid;
|
||||
error = ioctl(ctx->fd, VM_GET_MEMSEG, &memseg);
|
||||
if (error == 0) {
|
||||
|
|
Loading…
Reference in a new issue