fix minor bug coverity 74

length_remaining could become -1 and if so the next tvb access (tvb_memcpy()) would cause an exception.    not really an ethereal since it would have no ill effects in reality.



change !=0   to >0    to make it more clear what we actually test.




svn path=/trunk/; revision=17528
This commit is contained in:
Ronnie Sahlberg 2006-03-08 11:09:02 +00:00
parent 3a92bf963c
commit 3cd2777adc
1 changed files with 2 additions and 2 deletions

View File

@ -2741,7 +2741,7 @@ dissect_bgp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* Scan through the TCP payload looking for a BGP marker.
*/
while ((reported_length_remaining = tvb_reported_length_remaining(tvb, offset))
!= 0) {
> 0) {
/*
* "reported_length_remaining" is the number of bytes of TCP payload
* remaining. If it's more than the length of a BGP marker,
@ -2789,7 +2789,7 @@ dissect_bgp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* offset, in which case we can replace the loop below with
* a call to "tcp_dissect_pdus()".
*/
while (tvb_reported_length_remaining(tvb, offset) != 0) {
while (tvb_reported_length_remaining(tvb, offset) > 0) {
/*
* This will throw an exception if we don't have any data left.
* That's what we want. (See "tcp_dissect_pdus()", which is