Author: pfg
Date: Fri May 13 14:59:02 2016
New Revision: 299676
URL: https://svnweb.freebsd.org/changeset/base/299676

Log:
  bhyve: consider the bogus case of a negative bar idx.
  
  This is a followup to r297472 to squelch Coverity.
  
  CID:  1194319

Modified:
  head/usr.sbin/bhyve/pci_emul.c

Modified: head/usr.sbin/bhyve/pci_emul.c
==============================================================================
--- head/usr.sbin/bhyve/pci_emul.c      Fri May 13 14:38:04 2016        
(r299675)
+++ head/usr.sbin/bhyve/pci_emul.c      Fri May 13 14:59:02 2016        
(r299676)
@@ -2034,7 +2034,7 @@ pci_emul_diow(struct vmctx *ctx, int vcp
                 */
        }
 
-       if (baridx > 2) {
+       if (baridx > 2 || baridx < 0) {
                printf("diow: unknown bar idx %d\n", baridx);
        }
 }
@@ -2089,7 +2089,7 @@ pci_emul_dior(struct vmctx *ctx, int vcp
        }
 
 
-       if (baridx > 2) {
+       if (baridx > 2 || baridx < 0) {
                printf("dior: unknown bar idx %d\n", baridx);
                return (0);
        }
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to