Coverity's run 14 CID 82.

an off by one error (> vs >= in bounds check).


svn path=/trunk/; revision=17520
This commit is contained in:
Luis Ontanon 2006-03-08 10:14:51 +00:00
parent 8284947d84
commit 3fa91ab7be
1 changed files with 2 additions and 2 deletions

View File

@ -354,8 +354,8 @@ int network_instruments_dump_can_write_encap(int encap)
/* Per-packet encapsulations aren't supported. */
if (encap == WTAP_ENCAP_PER_PACKET)
return WTAP_ERR_ENCAP_PER_PACKET_UNSUPPORTED;
if (encap < 0 || (unsigned) encap > NUM_FROM_WTAP_ENCAPS || from_wtap_encap[encap] == OBSERVER_UNDEFINED)
if (encap < 0 || (unsigned) encap >= NUM_FROM_WTAP_ENCAPS || from_wtap_encap[encap] == OBSERVER_UNDEFINED)
return WTAP_ERR_UNSUPPORTED_ENCAP;
return 0;