]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
bhyve: avoid theoretical stack buffer overflow from integer overflow
authoremaste <emaste@FreeBSD.org>
Tue, 25 Jun 2019 19:06:43 +0000 (19:06 +0000)
committeremaste <emaste@FreeBSD.org>
Tue, 25 Jun 2019 19:06:43 +0000 (19:06 +0000)
commitaa773f3e23e9fab80c044a5d67488d93c1c1af68
treebf2a1ca8ee90724f13f48a3d29166f07b784f028
parent5e80329f9cce24a4239ff398a06797f639d40d59
bhyve: avoid theoretical stack buffer overflow from integer overflow

Use the proper size_t type to match strlen's return type.  This is not
exploitable in practice as this parses command line arguments, which
are limited to well below 2^31 bytes.

This is a minimal change to address the reported issue; hda_parse_config
and the rest of this file will benefit from further review.

Reported by: Fakhri Zulkifli
Reviewed by: jhb, markj
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
usr.sbin/bhyve/pci_hda.c