Text   |  XML   |  ReML   |   Visible Warnings:

Unreachable Control Flow  at wimax_tlv.c:95

No properties have been set. | edit properties
Jump to warning location ↓ warning details...
Show Events | Options

init_tlv_info

(/home/sate/Testcases/c/cve/wireshark-1.2.0/plugins/wimax/wimax_tlv.c)expand/collapse
Show more  
 54  gint init_tlv_info(tlv_info_t *this, tvbuff_t *tvb, gint offset)
 55  {
 56          guint tlv_len;
 57   
 58          /* get TLV type */
 59          this->type = (guint8)tvb_get_guint8( tvb, offset );
 60          /* get TLV length */
 61          tlv_len = (guint)tvb_get_guint8( tvb, (offset + 1) );
 62          /* set the TLV value offset */
 63          this->value_offset = 2;
 64          /* adjust for multiple-byte TLV length */
 65          if((tlv_len & WIMAX_TLV_EXTENDED_LENGTH_MASK) != 0)
 66          {       /* multiple bytes TLV length */
 67                  this->length_type = 1;
 68                  /* get the size of the TLV length */
 69                  tlv_len = (tlv_len & WIMAX_TLV_LENGTH_MASK);
 70                  this->size_of_length = tlv_len;
 71                  /* update the TLV value offset */
 72                  this->value_offset += tlv_len;
 73                  switch (tlv_len)
 74                  {
 75                          case 0:
 76                                  this->length = 0;  /* no length */
 77                          break;
 78                          case 1:
 79                                  this->length = (gint32)tvb_get_guint8( tvb, (offset + 2) ); /* 8 bit */
 80                          break;
 81                          case 2:
 82                                  this->length = (gint32)tvb_get_ntohs( tvb, (offset + 2) ); /* 16 bit */
 83                          break;
 84                          case 3:
 85                                  this->length = (gint32)tvb_get_ntoh24( tvb, (offset + 2) ); /* 24 bit */
 86                          break;
 87                          case 4:
 88                                  this->length = (gint32)tvb_get_ntohl( tvb, (offset + 2) ); /* 32 bit */
 89                          break;
 90                          default:
 91                                  /* mark invalid tlv */
 92                                  this->valid = 0;
 93                                  /* failed, return the invalid size of the tlv length */
 94                                  return (gint)tlv_len;
 95                          break;
 96                  }
 97          }
 98          else    /* single byte length */
 99          {
 100                  this->length_type = 0;
 101                  this->size_of_length = 0;
 102                  this->length = (gint32)tlv_len;
 103          }
 104          /* mark valid tlv */
 105          this->valid = 1;
 106          /* success */
 107          return 0;
 108  }
Show more  




Change Warning 3724.31180 : Unreachable Control Flow

Because they are very similar, this warning shares annotations with warning 3724.31329.

Priority:
State:
Finding:
Owner:
Note: