(/home/sate/Testcases/c/cve/wireshark-1.2.0/plugins/wimax/wimax_tlv.c) |
| |
| 54 | | | gint init_tlv_info(tlv_info_t *this, tvbuff_t *tvb, gint offset) |
| 55 | | | { |
| 56 | | | guint tlv_len; |
| 57 | | | |
| 58 | | | |
| 59 | | | this->type = (guint8)tvb_get_guint8( tvb, offset ); |
| 60 | | | |
| 61 | | | tlv_len = (guint)tvb_get_guint8( tvb, (offset + 1) ); |
| 62 | | | |
| 63 | | | this->value_offset = 2; |
| 64 | | | |
| 65 | | | if((tlv_len & WIMAX_TLV_EXTENDED_LENGTH_MASK) != 0) |
| 66 | | | { |
| 67 | | | this->length_type = 1; |
| 68 | | | |
| 69 | | | tlv_len = (tlv_len & WIMAX_TLV_LENGTH_MASK); |
| 70 | | | this->size_of_length = tlv_len; |
| 71 | | | |
| 72 | | | this->value_offset += tlv_len; |
| 73 | | | switch (tlv_len) |
| 74 | | | { |
| 75 | | | case 0: |
| 76 | | | this->length = 0; |
| 77 | | | break; |
| 78 | | | case 1: |
| 79 | | | this->length = (gint32)tvb_get_guint8( tvb, (offset + 2) ); |
| 80 | | | break; |
| 81 | | | case 2: |
| 82 | | | this->length = (gint32)tvb_get_ntohs( tvb, (offset + 2) ); |
| 83 | | | break; |
| 84 | | | case 3: |
| 85 | | | this->length = (gint32)tvb_get_ntoh24( tvb, (offset + 2) ); |
| 86 | | | break; |
| 87 | | | case 4: |
| 88 | | | this->length = (gint32)tvb_get_ntohl( tvb, (offset + 2) ); |
| 89 | | | break; |
| 90 | | | default: |
| 91 | | | |
| 92 | | | this->valid = 0; |
| 93 | | | |
| 94 | | | return (gint)tlv_len; |
| 95 | | | break; |
Unreachable Control Flow
The highlighted code will not execute under any circumstances. This may be because of: |
|
| 96 | | | } |
| 97 | | | } |
| 98 | | | else |
| 99 | | | { |
| 100 | | | this->length_type = 0; |
| 101 | | | this->size_of_length = 0; |
| 102 | | | this->length = (gint32)tlv_len; |
| 103 | | | } |
| 104 | | | |
| 105 | | | this->valid = 1; |
| 106 | | | |
| 107 | | | return 0; |
| 108 | | | } |
| |