Map negative types passed to vm_capability_type2name to NULL.

Submitted by:	vangyzen
This commit is contained in:
jhb 2020-04-21 21:48:35 +00:00
parent fbcfdb4579
commit 7ed94416c0

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