(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-eth.c) |
| |
| 99 | | | capture_eth(const guchar *pd, int offset, int len, packet_counts *ld) |
| 100 | | | { |
| 101 | | | guint16 etype, length; |
| 102 | | | int ethhdr_type; |
| 103 | | | |
| 104 | | | if (!BYTES_ARE_IN_FRAME(offset, len, )) {
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/packet.h |
| |
53 | #define BYTES_ARE_IN_FRAME(offset, captured_len, len) \ |
54 | ((guint)(offset) + (guint)(len) > (guint)(offset) && \ |
55 | (guint)(offset) + (guint)(len) <= (guint)(captured_len)) |
| |
|
| 105 | | | ld->other++; |
| 106 | | | return; |
| 107 | | | } |
| 108 | | | |
| 109 | | | etype = pntohs(&pd[offset+12]);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/pint.h |
| |
37 | #define pntohs(p) ((guint16) \ |
38 | ((guint16)*((const guint8 *)(p)+0)<<8| \ |
39 | (guint16)*((const guint8 *)(p)+1)<<0)) |
| |
|
| 110 | | | |
| 111 | | | if (etype <= IEEE_802_3_MAX_LEN) { |
| 112 | | | |
| 113 | | | |
| 114 | | | |
| 115 | | | |
| 116 | | | if ((pd[offset] == 0x01 || pd[offset] == 0x0C) && pd[offset+1] == 0x00 |
| 117 | | | && pd[offset+2] == 0x0C && pd[offset+3] == 0x00 |
| 118 | | | && pd[offset+4] == 0x00) { |
Unreachable Call
The highlighted code will not execute under any circumstances. This may be because of: |
|
| 119 | | | capture_isl(pd, offset, len, ld); |
| 120 | | | return; |
| 121 | | | } |
| 122 | | | } |
| 123 | | | |
| 124 | | | |
| 125 | | | |
| 126 | | | |
| 127 | | | |
| 128 | | | |
| 129 | | | |
| 130 | | | |
| 131 | | | |
| 132 | | | |
| 133 | | | |
| 134 | | | |
| 135 | | | |
| 136 | | | |
| 137 | | | |
| 138 | | | |
| 139 | | | |
| 140 | | | if (etype <= IEEE_802_3_MAX_LEN && etype != ETHERTYPE_UNK) { |
| 141 | | | length = etype; |
| 142 | | | |
| 143 | | | |
| 144 | | | |
| 145 | | | |
| 146 | | | |
| 147 | | | |
| 148 | | | |
| 149 | | | if (pd[offset+14] == 0xff && pd[offset+15] == 0xff) { |
| 150 | | | ethhdr_type = ETHERNET_802_3; |
| 151 | | | } |
| 152 | | | else { |
| 153 | | | ethhdr_type = ETHERNET_802_2; |
| 154 | | | } |
| 155 | | | |
| 156 | | | |
| 157 | | | |
| 158 | | | |
| 159 | | | |
| 160 | | | |
| 161 | | | length += offset + ; |
| 162 | | | if (len > length) |
| 163 | | | len = length; |
| 164 | | | } else { |
| 165 | | | ethhdr_type = ETHERNET_II; |
| 166 | | | } |
| 167 | | | offset += ; |
| 168 | | | |
| 169 | | | switch (ethhdr_type) { |
| 170 | | | case ETHERNET_802_3: |
| 171 | | | capture_ipx(ld); |
| 172 | | | break; |
| 173 | | | case ETHERNET_802_2: |
| 174 | | | capture_llc(pd, offset, len, ld); |
| 175 | | | break; |
| 176 | | | case ETHERNET_II: |
| 177 | | | capture_ethertype(etype, pd, offset, len, ld); |
| 178 | | | break; |
| 179 | | | } |
| 180 | | | } |
| |