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);
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to