svn commit: r360178 - head/lib/libvmmapi

John Baldwin jhb at FreeBSD.org
Tue Apr 21 21:48:36 UTC 2020


Author: jhb
Date: Tue Apr 21 21:48:35 2020
New Revision: 360178
URL: https://svnweb.freebsd.org/changeset/base/360178

Log:
  Map negative types passed to vm_capability_type2name to NULL.
  
  Submitted by:	vangyzen

Modified:
  head/lib/libvmmapi/vmmapi.c

Modified: head/lib/libvmmapi/vmmapi.c
==============================================================================
--- head/lib/libvmmapi/vmmapi.c	Tue Apr 21 21:34:24 2020	(r360177)
+++ head/lib/libvmmapi/vmmapi.c	Tue Apr 21 21:48:35 2020	(r360178)
@@ -841,7 +841,7 @@ vm_capability_name2type(const char *capname)
 const char *
 vm_capability_type2name(int type)
 {
-	if (type < nitems(capstrmap))
+	if (type >= 0 && type < nitems(capstrmap))
 		return (capstrmap[type]);
 
 	return (NULL);


More information about the svn-src-head mailing list