Map negative types passed to vm_capability_type2name to NULL.

Submitted by:	vangyzen
This commit is contained in:
John Baldwin 2020-04-21 21:48:35 +00:00
parent 47332982bc
commit 24c2e17d2b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=360178

View file

@ -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);