Date: Fri, 27 Mar 2015 08:56:45 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280747 - stable/10/usr.sbin/bhyve Message-ID: <201503270856.t2R8ujvl026501@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Fri Mar 27 08:56:44 2015 New Revision: 280747 URL: https://svnweb.freebsd.org/changeset/base/280747 Log: MFC r280044: According to Linux and QEMU, s/n equal to buffer is not zero-terminated. This makes same s/n reported for both virtio and AHCI drivers. Modified: stable/10/usr.sbin/bhyve/pci_virtio_block.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/pci_virtio_block.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_virtio_block.c Fri Mar 27 08:55:54 2015 (r280746) +++ stable/10/usr.sbin/bhyve/pci_virtio_block.c Fri Mar 27 08:56:44 2015 (r280747) @@ -263,7 +263,9 @@ pci_vtblk_proc(struct pci_vtblk_softc *s break; case VBH_OP_IDENT: /* Assume a single buffer */ - strlcpy(iov[1].iov_base, sc->vbsc_ident, + /* S/n equal to buffer is not zero-terminated. */ + memset(iov[1].iov_base, 0, iov[1].iov_len); + strncpy(iov[1].iov_base, sc->vbsc_ident, MIN(iov[1].iov_len, sizeof(sc->vbsc_ident))); pci_vtblk_done(&io->io_req, 0); return;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201503270856.t2R8ujvl026501>