(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-frame.c) |
| |
| 115 | | | dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) |
| 116 | | | { |
| 117 | | | proto_tree *fh_tree=NULL; |
| 118 | | | proto_item *volatile ti = NULL; |
| 119 | | | nstime_t ts; |
| 120 | | | int cap_len = 0, frame_len = 0; |
| 121 | | | proto_tree *volatile tree; |
| 122 | | | proto_item *item; |
| 123 | | | guint32 frame_number; |
| 124 | | | |
| 125 | | | frame_number=pinfo->fd->num; |
| 126 | | | |
| 127 | | | |
| 128 | | | |
| 129 | | | tree=parent_tree; |
| 130 | | | |
| 131 | | | pinfo->current_proto = "Frame"; |
| 132 | | | |
| 133 | | | if (pinfo-> != NULL) { |
Event 1:
Taking true branch. pinfo-> != (void *)0 evaluates to true.
hide
|
|
| 134 | | | switch (pinfo->fd->lnk_t) { |
Event 2:
pinfo->fd->lnk_t evaluates to 35.
hide
|
|
| 135 | | | |
| 136 | | | case WTAP_ENCAP_WFLEET_HDLC: |
| 137 | | | case WTAP_ENCAP_CHDLC_WITH_PHDR: |
| 138 | | | case WTAP_ENCAP_PPP_WITH_PHDR: |
| 139 | | | case WTAP_ENCAP_SDLC: |
| 140 | | | case WTAP_ENCAP_BLUETOOTH_H4: |
| 141 | | | case WTAP_ENCAP_BLUETOOTH_H4_WITH_PHDR: |
| 142 | | | pinfo->p2p_dir = pinfo->->p2p.sent ? |
Event 3:
pinfo->->p2p.sent evaluates to true.
hide
|
|
| 143 | | | P2P_DIR_SENT : P2P_DIR_RECV; |
| 144 | | | break; |
| 145 | | | |
| 146 | | | case WTAP_ENCAP_BLUETOOTH_HCI:
x /home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/wtap.h |
| |
195 | #define WTAP_ENCAP_BLUETOOTH_HCI 102 /*raw packets without a transport layer e.g. H4*/ |
| |
|
| 147 | | | pinfo->p2p_dir = pinfo->->bthci.sent; |
| 148 | | | break; |
| 149 | | | |
| 150 | | | case WTAP_ENCAP_LAPB: |
| 151 | | | case WTAP_ENCAP_FRELAY_WITH_PHDR: |
| 152 | | | pinfo->p2p_dir = |
| 153 | | | (pinfo->->x25.flags & FROM_DCE) ? |
| 154 | | | P2P_DIR_RECV : P2P_DIR_SENT; |
| 155 | | | break; |
| 156 | | | |
| 157 | | | case WTAP_ENCAP_ISDN: |
| 158 | | | pinfo->p2p_dir = pinfo->->isdn.uton ? |
| 159 | | | P2P_DIR_SENT : P2P_DIR_RECV; |
| 160 | | | break; |
| 161 | | | |
| 162 | | | case WTAP_ENCAP_LINUX_LAPD: |
| 163 | | | pinfo->p2p_dir = (pinfo->->lapd.pkttype == 3 || |
| 164 | | | pinfo->->lapd.pkttype == 4) ? |
| 165 | | | P2P_DIR_SENT : P2P_DIR_RECV; |
| 166 | | | break; |
| 167 | | | |
| 168 | | | case WTAP_ENCAP_MTP2_WITH_PHDR: |
| 169 | | | pinfo->p2p_dir = pinfo->->mtp2.sent ? |
| 170 | | | P2P_DIR_SENT : P2P_DIR_RECV; |
| 171 | | | pinfo->link_number = pinfo->->mtp2.link_number; |
| 172 | | | pinfo->annex_a_used = pinfo->->mtp2.annex_a_used; |
| 173 | | | break; |
| 174 | | | |
| 175 | | | case WTAP_ENCAP_GSM_UM: |
| 176 | | | pinfo->p2p_dir = pinfo->->gsm_um.uplink ? |
| 177 | | | P2P_DIR_SENT : P2P_DIR_RECV; |
| 178 | | | break; |
| 179 | | | |
| 180 | | | } |
| 181 | | | } |
| 182 | | | |
| 183 | | | |
| 184 | | | if (tree) { |
Event 5:
Taking true branch. tree evaluates to true.
hide
|
|
| 185 | | | cap_len = tvb_length(tvb); |
| 186 | | | frame_len = tvb_reported_length(tvb); |
| 187 | | | |
| 188 | | | ti = proto_tree_add_protocol_format(tree, proto_frame, tvb, 0, -1, |
| 189 | | | "Frame %u (%u bytes on wire, %u bytes captured)", pinfo->fd->num, frame_len, cap_len); |
| 190 | | | |
| 191 | | | fh_tree = proto_item_add_subtree(ti, ett_frame); |
| 192 | | | } |
| 193 | | | |
| 194 | | | |
| 195 | | | |
| 196 | | | |
| 197 | | | |
| 198 | | | if(!proto_field_is_referenced(tree, proto_frame)){ |
Event 6:
Skipping " if". proto_field_is_referenced(...) evaluates to true.
hide
|
|
| 199 | | | tree=NULL; |
| 200 | | | fh_tree = NULL; |
| 201 | | | } |
| 202 | | | |
| 203 | | | |
| 204 | | | if (fh_tree) { |
Event 7:
Taking true branch. fh_tree evaluates to true.
hide
|
|
| 205 | | | ts = pinfo->fd->abs_ts; |
| 206 | | | |
| 207 | | | proto_tree_add_time(fh_tree, hf_frame_arrival_time, tvb, |
| 208 | | | 0, 0, &ts); |
| 209 | | | if(ts.nsecs < 0 || ts.nsecs >= 1000000000) { |
Event 8:
Skipping " if". - ts.nsecs < 0 evaluates to false.
- ts.nsecs >= 1000000000 evaluates to false.
hide
|
|
| 210 | | | item = proto_tree_add_none_format(fh_tree, hf_frame_time_invalid, tvb, |
| 211 | | | 0, 0, "Arrival Time: Fractional second %09ld is invalid, the valid range is 0-1000000000", (long) ts.nsecs); |
| 212 | | | PROTO_ITEM_SET_GENERATED(item);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
325 | #define PROTO_ITEM_SET_GENERATED(proto_item) \ |
326 | ((proto_item) ? FI_SET_FLAG((proto_item)->finfo, FI_GENERATED) : 0) |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
246 | #define FI_SET_FLAG(fi, flag) (fi->flags = fi->flags | flag) |
| |
|
| 213 | | | expert_add_info_format(pinfo, item, PI_MALFORMED, PI_WARN, "Arrival Time: Fractional second out of range (0-1000000000)"); |
| 214 | | | } |
| 215 | | | |
| 216 | | | ts = pinfo->fd->del_cap_ts; |
| 217 | | | |
| 218 | | | item = proto_tree_add_time(fh_tree, hf_frame_time_delta, tvb, |
| 219 | | | 0, 0, &ts); |
| 220 | | | PROTO_ITEM_SET_GENERATED(item);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
325 | #define PROTO_ITEM_SET_GENERATED(proto_item) \ |
326 | ((proto_item) ? FI_SET_FLAG((proto_item)->finfo, FI_GENERATED) : 0) |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
246 | #define FI_SET_FLAG(fi, flag) (fi->flags = fi->flags | flag) |
| |
|
Event 9:
item evaluates to true.
hide
|
|
| 221 | | | |
| 222 | | | ts = pinfo->fd->del_dis_ts; |
| 223 | | | |
| 224 | | | item = proto_tree_add_time(fh_tree, hf_frame_time_delta_displayed, tvb, |
| 225 | | | 0, 0, &ts); |
| 226 | | | PROTO_ITEM_SET_GENERATED(item);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
325 | #define PROTO_ITEM_SET_GENERATED(proto_item) \ |
326 | ((proto_item) ? FI_SET_FLAG((proto_item)->finfo, FI_GENERATED) : 0) |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
246 | #define FI_SET_FLAG(fi, flag) (fi->flags = fi->flags | flag) |
| |
|
Event 10:
item evaluates to true.
hide
|
|
| 227 | | | |
| 228 | | | ts = pinfo->fd->rel_ts; |
| 229 | | | |
| 230 | | | item = proto_tree_add_time(fh_tree, hf_frame_time_relative, tvb, |
| 231 | | | 0, 0, &ts); |
| 232 | | | PROTO_ITEM_SET_GENERATED(item);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
325 | #define PROTO_ITEM_SET_GENERATED(proto_item) \ |
326 | ((proto_item) ? FI_SET_FLAG((proto_item)->finfo, FI_GENERATED) : 0) |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
246 | #define FI_SET_FLAG(fi, flag) (fi->flags = fi->flags | flag) |
| |
|
Event 11:
item evaluates to true.
hide
|
|
| 233 | | | |
| 234 | | | if(pinfo->fd->flags.ref_time){ |
Event 12:
Skipping " if". pinfo->fd->flags.ref_time evaluates to false.
hide
|
|
| 235 | | | ti = proto_tree_add_item(fh_tree, hf_frame_time_reference, tvb, 0, 0, FALSE); |
| 236 | | | PROTO_ITEM_SET_GENERATED(ti);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
325 | #define PROTO_ITEM_SET_GENERATED(proto_item) \ |
326 | ((proto_item) ? FI_SET_FLAG((proto_item)->finfo, FI_GENERATED) : 0) |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
246 | #define FI_SET_FLAG(fi, flag) (fi->flags = fi->flags | flag) |
| |
|
| 237 | | | } |
| 238 | | | |
| 239 | | | proto_tree_add_uint(fh_tree, hf_frame_number, tvb, |
| 240 | | | 0, 0, pinfo->fd->num); |
| 241 | | | |
| 242 | | | proto_tree_add_uint_format(fh_tree, hf_frame_len, tvb, |
| 243 | | | 0, 0, frame_len, "Frame Length: %d byte%s", frame_len, |
| 244 | | | plurality(frame_len, "", "s")); |
Event 13:
frame_len == 1 evaluates to true.
hide
|
|
| 245 | | | |
| 246 | | | proto_tree_add_uint_format(fh_tree, hf_frame_capture_len, tvb, |
| 247 | | | 0, 0, cap_len, "Capture Length: %d byte%s", cap_len, |
| 248 | | | plurality(cap_len, "", "s")); |
Event 14:
cap_len == 1 evaluates to true.
hide
|
|
| 249 | | | |
| 250 | | | if (generate_md5_hash) { |
Event 15:
Skipping " if". generate_md5_hash evaluates to false.
hide
|
|
| 251 | | | const guint8 *cp; |
| 252 | | | md5_state_t md_ctx; |
| 253 | | | md5_byte_t digest[16]; |
| 254 | | | gchar *digest_string; |
| 255 | | | |
| 256 | | | cp = tvb_get_ptr(tvb, 0, cap_len); |
| 257 | | | |
| 258 | | | md5_init(&md_ctx); |
| 259 | | | md5_append(&md_ctx, cp, cap_len); |
| 260 | | | md5_finish(&md_ctx, digest); |
| 261 | | | |
| 262 | | | digest_string = bytestring_to_str(digest, 16, '\0'); |
| 263 | | | ti = proto_tree_add_string(fh_tree, hf_frame_md5_hash, tvb, 0, 0, digest_string); |
| 264 | | | PROTO_ITEM_SET_GENERATED(ti);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
325 | #define PROTO_ITEM_SET_GENERATED(proto_item) \ |
326 | ((proto_item) ? FI_SET_FLAG((proto_item)->finfo, FI_GENERATED) : 0) |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
246 | #define FI_SET_FLAG(fi, flag) (fi->flags = fi->flags | flag) |
| |
|
| 265 | | | } |
| 266 | | | |
| 267 | | | ti = proto_tree_add_boolean(fh_tree, hf_frame_marked, tvb, 0, 0,pinfo->fd->flags.marked); |
| 268 | | | PROTO_ITEM_SET_GENERATED(ti);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
325 | #define PROTO_ITEM_SET_GENERATED(proto_item) \ |
326 | ((proto_item) ? FI_SET_FLAG((proto_item)->finfo, FI_GENERATED) : 0) |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
246 | #define FI_SET_FLAG(fi, flag) (fi->flags = fi->flags | flag) |
| |
|
Event 16:
ti evaluates to true.
hide
|
|
| 269 | | | |
| 270 | | | |
| 271 | | | |
| 272 | | | |
| 273 | | | |
| 274 | | | |
| 275 | | | |
| 276 | | | |
| 277 | | | proto_tree_set_visible(fh_tree, TRUE); |
Event 17:
!0 evaluates to true.
hide
|
|
| 278 | | | |
| 279 | | | ti = proto_tree_add_string(fh_tree, hf_frame_protocols, tvb, |
| 280 | | | 0, 0, ""); |
| 281 | | | PROTO_ITEM_SET_GENERATED(ti);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
325 | #define PROTO_ITEM_SET_GENERATED(proto_item) \ |
326 | ((proto_item) ? FI_SET_FLAG((proto_item)->finfo, FI_GENERATED) : 0) |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
246 | #define FI_SET_FLAG(fi, flag) (fi->flags = fi->flags | flag) |
| |
|
Event 18:
ti evaluates to true.
hide
|
|
| 282 | | | pinfo->layer_names = g_string_new(""); |
| 283 | | | |
| 284 | | | |
| 285 | | | if (pinfo->p2p_dir != P2P_DIR_UNKNOWN) { |
Event 20:
Taking true branch. pinfo->p2p_dir != -1 evaluates to true.
hide
|
|
| 286 | | | proto_tree_add_int(fh_tree, hf_frame_p2p_dir, tvb, |
| 287 | | | 0, 0, pinfo->p2p_dir); |
| 288 | | | } |
| 289 | | | |
| 290 | | | |
| 291 | | | if ((pinfo-> != NULL ) && (pinfo->fd->lnk_t == WTAP_ENCAP_MTP2_WITH_PHDR)) { |
Null Test After Dereference
This code tests the nullness of pinfo->, which has already been dereferenced. - If pinfo-> were null, there would have been a prior null pointer dereference at packet-frame.c:142, and potentially at other locations as well.
- Either this test is redundant, or the earlier dereference(s) should be guarded by a similar test.
The issue can occur if the highlighted code executes. See related event 4. Show: All events | Only primary events |
|
| 292 | | | proto_tree_add_uint(fh_tree, hf_link_number, tvb, |
| 293 | | | 0, 0, pinfo->link_number); |
| 294 | | | } |
| 295 | | | |
| 296 | | | if (show_file_off) { |
| 297 | | | proto_tree_add_int64_format(fh_tree, hf_frame_file_off, tvb, |
| 298 | | | 0, 0, pinfo->fd->file_off, |
| 299 | | | "File Offset: %" G_GINT64_MODIFIER "d (0x%" G_GINT64_MODIFIER "x)", |
| 300 | | | pinfo->fd->file_off, pinfo->fd->file_off); |
| 301 | | | } |
| 302 | | | |
| 303 | | | if(pinfo->fd->color_filter != NULL) { |
| 304 | | | color_filter_t *color_filter = pinfo->fd->color_filter; |
| 305 | | | item = proto_tree_add_string(fh_tree, hf_frame_color_filter_name, tvb, |
| 306 | | | 0, 0, color_filter->filter_name); |
| 307 | | | PROTO_ITEM_SET_GENERATED(item);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
325 | #define PROTO_ITEM_SET_GENERATED(proto_item) \ |
326 | ((proto_item) ? FI_SET_FLAG((proto_item)->finfo, FI_GENERATED) : 0) |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
246 | #define FI_SET_FLAG(fi, flag) (fi->flags = fi->flags | flag) |
| |
|
| 308 | | | item = proto_tree_add_string(fh_tree, hf_frame_color_filter_text, tvb, |
| 309 | | | 0, 0, color_filter->filter_text); |
| 310 | | | PROTO_ITEM_SET_GENERATED(item);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
325 | #define PROTO_ITEM_SET_GENERATED(proto_item) \ |
326 | ((proto_item) ? FI_SET_FLAG((proto_item)->finfo, FI_GENERATED) : 0) |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
246 | #define FI_SET_FLAG(fi, flag) (fi->flags = fi->flags | flag) |
| |
|
| 311 | | | } |
| 312 | | | } else { |
| 313 | | | if(pinfo->fd->abs_ts.nsecs < 0 || pinfo->fd->abs_ts.nsecs >= 1000000000) { |
| 314 | | | expert_add_info_format(pinfo, NULL, PI_MALFORMED, PI_WARN, "Arrival Time: Fractional second out of range (0-1000000000)"); |
| 315 | | | } |
| 316 | | | } |
| 317 | | | |
| 318 | | | |
| 319 | | | TRY {
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/exceptions.h |
| |
176 | #define TRY \ |
177 | {\ |
178 | except_t *exc; \ |
179 | volatile int except_state = 0; \ |
180 | static const except_id_t catch_spec[] = { \ |
181 | { XCEPT_GROUP_WIRESHARK, XCEPT_CODE_ANY } }; \ |
182 | except_try_push(catch_spec, 1, &exc); \ |
183 | \ |
184 | if(except_state & EXCEPT_CAUGHT) \ |
185 | except_state |= EXCEPT_RETHROWN; \ |
186 | except_state &= ~EXCEPT_CAUGHT; \ |
187 | \ |
188 | if (except_state == 0 && exc == 0) \ |
189 | /* user's code goes here */ |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/except.h |
| |
143 | #define except_try_push(ID, NUM, PPE) \ |
144 | { \ |
145 | struct except_stacknode except_sn; \ |
146 | struct except_catch except_ch; \ |
147 | except_setup_try(&except_sn, &except_ch, ID, NUM); \ |
148 | if (setjmp(except_ch.except_jmp)) \ |
149 | *(PPE) = &except_ch.except_obj; \ |
150 | else \ |
151 | *(PPE) = 0 |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/exceptions.h |
| |
165 | #define EXCEPT_CAUGHT 1 /* exception has been caught, no need to rethrow at |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/exceptions.h |
| |
168 | #define EXCEPT_RETHROWN 2 /* the exception was rethrown from a CATCH |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/exceptions.h |
| |
165 | #define EXCEPT_CAUGHT 1 /* exception has been caught, no need to rethrow at |
| |
|
| 320 | | | #ifdef _MSC_VER |
| 321 | | | |
| 322 | | | |
| 323 | | | __try { |
| 324 | | | #endif |
| 325 | | | if ((force_docsis_encap) && (docsis_handle)) { |
| 326 | | | call_dissector(docsis_handle, tvb, pinfo, parent_tree); |
| 327 | | | } else { |
| 328 | | | if (!dissector_try_port(wtap_encap_dissector_table, pinfo->fd->lnk_t, |
| 329 | | | tvb, pinfo, parent_tree)) { |
| 330 | | | |
| 331 | | | if (check_col(pinfo->cinfo, COL_PROTOCOL)) |
| 332 | | | col_set_str(pinfo->cinfo, COL_PROTOCOL, "UNKNOWN"); |
| 333 | | | if (check_col(pinfo->cinfo, COL_INFO)) |
| 334 | | | col_add_fstr(pinfo->cinfo, COL_INFO, "WTAP_ENCAP = %u", |
| 335 | | | pinfo->fd->lnk_t); |
| 336 | | | call_dissector(data_handle,tvb, pinfo, parent_tree); |
| 337 | | | } |
| 338 | | | } |
| 339 | | | #ifdef _MSC_VER |
| 340 | | | } __except(TRUE ) { |
| 341 | | | switch(GetExceptionCode()) { |
| 342 | | | case(STATUS_ACCESS_VIOLATION): |
| 343 | | | show_exception(tvb, pinfo, parent_tree, DissectorError, |
| 344 | | | "STATUS_ACCESS_VIOLATION: dissector accessed an invalid memory address"); |
| 345 | | | break; |
| 346 | | | case(STATUS_INTEGER_DIVIDE_BY_ZERO): |
| 347 | | | show_exception(tvb, pinfo, parent_tree, DissectorError, |
| 348 | | | "STATUS_INTEGER_DIVIDE_BY_ZERO: dissector tried an integer division by zero"); |
| 349 | | | break; |
| 350 | | | case(STATUS_STACK_OVERFLOW): |
| 351 | | | show_exception(tvb, pinfo, parent_tree, DissectorError, |
| 352 | | | "STATUS_STACK_OVERFLOW: dissector overflowed the stack (e.g. endless loop)"); |
| 353 | | | |
| 354 | | | break; |
| 355 | | | |
| 356 | | | default: |
| 357 | | | show_exception(tvb, pinfo, parent_tree, DissectorError, |
| 358 | | | g_strdup_printf("dissector caused an unknown exception: 0x%x", GetExceptionCode())); |
| 359 | | | } |
| 360 | | | } |
| 361 | | | #endif |
| 362 | | | } |
| 363 | | | CATCH(OutOfMemoryError) {
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/exceptions.h |
| |
202 | #define CATCH(x) \ |
203 | if (except_state == 0 && exc != 0 && exc->except_id.except_code == (x) && \ |
204 | (except_state |= EXCEPT_CAUGHT)) \ |
205 | /* user's code goes here */ |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/exceptions.h |
| |
165 | #define EXCEPT_CAUGHT 1 /* exception has been caught, no need to rethrow at |
| |
|
| 364 | | | RETHROW;
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/exceptions.h |
| |
231 | #define RETHROW \ |
232 | { \ |
233 | /* check we're in a catch block */ \ |
234 | g_assert(except_state == EXCEPT_CAUGHT); \ |
235 | /* we can't use except_rethrow here, as that pops a catch block \ |
236 | * off the stack, and we don't want to do that, because we want to \ |
237 | * excecute the FINALLY {} block first. \ |
238 | * except_throw doesn't provide an interface to rethrow an existing \ |
239 | * exception; however, longjmping back to except_try_push() has the \ |
240 | * desired effect. \ |
241 | * \ |
242 | * Note also that THROW and RETHROW should provide much the same \ |
243 | * functionality in terms of which blocks to enter, so any messing \ |
| |
x /usr/include/glib-2.0/glib/gtestutils.h |
| |
74 | #define g_assert(expr) do { if G_LIKELY (expr) ; else \ |
75 | g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \ |
76 | #expr); } while (0) |
| |
x /usr/include/glib-2.0/glib/gmacros.h |
| |
277 | #define G_LIKELY(expr) (__builtin_expect (_G_BOOLEAN_EXPR(expr), 1)) |
| |
x /usr/include/glib-2.0/glib/gmacros.h |
| |
268 | #define _G_BOOLEAN_EXPR(expr) \ |
269 | __extension__ ({ \ |
270 | int _g_boolean_var_; \ |
271 | if (expr) \ |
272 | _g_boolean_var_ = 1; \ |
273 | else \ |
274 | _g_boolean_var_ = 0; \ |
275 | _g_boolean_var_; \ |
276 | }) |
| |
x /usr/include/glib-2.0/glib/gmacros.h |
| |
160 | # define G_STRFUNC ((const char*) (__PRETTY_FUNCTION__)) |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/exceptions.h |
| |
165 | #define EXCEPT_CAUGHT 1 /* exception has been caught, no need to rethrow at |
| |
|
| 365 | | | } |
| 366 | | | CATCH_ALL {
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/exceptions.h |
| |
213 | #define CATCH_ALL \ |
214 | if (except_state == 0 && exc != 0 && \ |
215 | (except_state|=EXCEPT_CAUGHT)) \ |
216 | /* user's code goes here */ |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/exceptions.h |
| |
165 | #define EXCEPT_CAUGHT 1 /* exception has been caught, no need to rethrow at |
| |
|
| 367 | | | show_exception(tvb, pinfo, parent_tree, EXCEPT_CODE, GET_MESSAGE); |
| 368 | | | } |
| 369 | | | ENDTRY;
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/exceptions.h |
| |
191 | #define ENDTRY \ |
192 | /* rethrow the exception if necessary */ \ |
193 | if(!(except_state&EXCEPT_CAUGHT) && exc != 0) \ |
194 | except_rethrow(exc); \ |
195 | except_try_pop();\ |
196 | } |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/exceptions.h |
| |
165 | #define EXCEPT_CAUGHT 1 /* exception has been caught, no need to rethrow at |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/except.h |
| |
153 | #define except_try_pop() \ |
154 | except_free(except_ch.except_obj.except_dyndata); \ |
155 | except_pop(); \ |
156 | } |
| |
|
| 370 | | | |
| 371 | | | if (tree && pinfo->layer_names) { |
| 372 | | | proto_item_append_string(ti, pinfo->layer_names->str); |
| 373 | | | g_string_free(pinfo->layer_names, TRUE); |
| 374 | | | pinfo->layer_names = NULL; |
| 375 | | | } |
| 376 | | | |
| 377 | | | |
| 378 | | | |
| 379 | | | |
| 380 | | | if (have_postdissector()) { |
| 381 | | | TRY {
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/exceptions.h |
| |
176 | #define TRY \ |
177 | {\ |
178 | except_t *exc; \ |
179 | volatile int except_state = 0; \ |
180 | static const except_id_t catch_spec[] = { \ |
181 | { XCEPT_GROUP_WIRESHARK, XCEPT_CODE_ANY } }; \ |
182 | except_try_push(catch_spec, 1, &exc); \ |
183 | \ |
184 | if(except_state & EXCEPT_CAUGHT) \ |
185 | except_state |= EXCEPT_RETHROWN; \ |
186 | except_state &= ~EXCEPT_CAUGHT; \ |
187 | \ |
188 | if (except_state == 0 && exc == 0) \ |
189 | /* user's code goes here */ |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/except.h |
| |
143 | #define except_try_push(ID, NUM, PPE) \ |
144 | { \ |
145 | struct except_stacknode except_sn; \ |
146 | struct except_catch except_ch; \ |
147 | except_setup_try(&except_sn, &except_ch, ID, NUM); \ |
148 | if (setjmp(except_ch.except_jmp)) \ |
149 | *(PPE) = &except_ch.except_obj; \ |
150 | else \ |
151 | *(PPE) = 0 |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/exceptions.h |
| |
165 | #define EXCEPT_CAUGHT 1 /* exception has been caught, no need to rethrow at |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/exceptions.h |
| |
168 | #define EXCEPT_RETHROWN 2 /* the exception was rethrown from a CATCH |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/exceptions.h |
| |
165 | #define EXCEPT_CAUGHT 1 /* exception has been caught, no need to rethrow at |
| |
|
| 382 | | | #ifdef _MSC_VER |
| 383 | | | |
| 384 | | | |
| 385 | | | __try { |
| 386 | | | #endif |
| 387 | | | call_all_postdissectors(tvb, pinfo, parent_tree); |
| 388 | | | #ifdef _MSC_VER |
| 389 | | | } __except(TRUE ) { |
| 390 | | | switch(GetExceptionCode()) { |
| 391 | | | case(STATUS_ACCESS_VIOLATION): |
| 392 | | | show_exception(tvb, pinfo, parent_tree, DissectorError, |
| 393 | | | "STATUS_ACCESS_VIOLATION: dissector accessed an invalid memory address"); |
| 394 | | | break; |
| 395 | | | case(STATUS_INTEGER_DIVIDE_BY_ZERO): |
| 396 | | | show_exception(tvb, pinfo, parent_tree, DissectorError, |
| 397 | | | "STATUS_INTEGER_DIVIDE_BY_ZERO: dissector tried an integer division by zero"); |
| 398 | | | break; |
| 399 | | | case(STATUS_STACK_OVERFLOW): |
| 400 | | | show_exception(tvb, pinfo, parent_tree, DissectorError, |
| 401 | | | "STATUS_STACK_OVERFLOW: dissector overflowed the stack (e.g. endless loop)"); |
| 402 | | | |
| 403 | | | break; |
| 404 | | | |
| 405 | | | default: |
| 406 | | | show_exception(tvb, pinfo, parent_tree, DissectorError, |
| 407 | | | g_strdup_printf("dissector caused an unknown exception: 0x%x", GetExceptionCode())); |
| 408 | | | } |
| 409 | | | } |
| 410 | | | #endif |
| 411 | | | } |
| 412 | | | CATCH(OutOfMemoryError) {
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/exceptions.h |
| |
202 | #define CATCH(x) \ |
203 | if (except_state == 0 && exc != 0 && exc->except_id.except_code == (x) && \ |
204 | (except_state |= EXCEPT_CAUGHT)) \ |
205 | /* user's code goes here */ |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/exceptions.h |
| |
165 | #define EXCEPT_CAUGHT 1 /* exception has been caught, no need to rethrow at |
| |
|
| 413 | | | RETHROW;
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/exceptions.h |
| |
231 | #define RETHROW \ |
232 | { \ |
233 | /* check we're in a catch block */ \ |
234 | g_assert(except_state == EXCEPT_CAUGHT); \ |
235 | /* we can't use except_rethrow here, as that pops a catch block \ |
236 | * off the stack, and we don't want to do that, because we want to \ |
237 | * excecute the FINALLY {} block first. \ |
238 | * except_throw doesn't provide an interface to rethrow an existing \ |
239 | * exception; however, longjmping back to except_try_push() has the \ |
240 | * desired effect. \ |
241 | * \ |
242 | * Note also that THROW and RETHROW should provide much the same \ |
243 | * functionality in terms of which blocks to enter, so any messing \ |
| |
x /usr/include/glib-2.0/glib/gtestutils.h |
| |
74 | #define g_assert(expr) do { if G_LIKELY (expr) ; else \ |
75 | g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \ |
76 | #expr); } while (0) |
| |
x /usr/include/glib-2.0/glib/gmacros.h |
| |
277 | #define G_LIKELY(expr) (__builtin_expect (_G_BOOLEAN_EXPR(expr), 1)) |
| |
x /usr/include/glib-2.0/glib/gmacros.h |
| |
268 | #define _G_BOOLEAN_EXPR(expr) \ |
269 | __extension__ ({ \ |
270 | int _g_boolean_var_; \ |
271 | if (expr) \ |
272 | _g_boolean_var_ = 1; \ |
273 | else \ |
274 | _g_boolean_var_ = 0; \ |
275 | _g_boolean_var_; \ |
276 | }) |
| |
x /usr/include/glib-2.0/glib/gmacros.h |
| |
160 | # define G_STRFUNC ((const char*) (__PRETTY_FUNCTION__)) |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/exceptions.h |
| |
165 | #define EXCEPT_CAUGHT 1 /* exception has been caught, no need to rethrow at |
| |
|
| 414 | | | } |
| 415 | | | CATCH_ALL {
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/exceptions.h |
| |
213 | #define CATCH_ALL \ |
214 | if (except_state == 0 && exc != 0 && \ |
215 | (except_state|=EXCEPT_CAUGHT)) \ |
216 | /* user's code goes here */ |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/exceptions.h |
| |
165 | #define EXCEPT_CAUGHT 1 /* exception has been caught, no need to rethrow at |
| |
|
| 416 | | | show_exception(tvb, pinfo, parent_tree, EXCEPT_CODE, GET_MESSAGE); |
| 417 | | | } |
| 418 | | | ENDTRY;
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/exceptions.h |
| |
191 | #define ENDTRY \ |
192 | /* rethrow the exception if necessary */ \ |
193 | if(!(except_state&EXCEPT_CAUGHT) && exc != 0) \ |
194 | except_rethrow(exc); \ |
195 | except_try_pop();\ |
196 | } |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/exceptions.h |
| |
165 | #define EXCEPT_CAUGHT 1 /* exception has been caught, no need to rethrow at |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/except.h |
| |
153 | #define except_try_pop() \ |
154 | except_free(except_ch.except_obj.except_dyndata); \ |
155 | except_pop(); \ |
156 | } |
| |
|
| 419 | | | } |
| 420 | | | |
| 421 | | | tap_queue_packet(frame_tap, pinfo, NULL); |
| 422 | | | |
| 423 | | | |
| 424 | | | if (frame_end_routines) { |
| 425 | | | g_slist_foreach(frame_end_routines, &call_frame_end_routine, NULL); |
| 426 | | | g_slist_free(frame_end_routines); |
| 427 | | | frame_end_routines = NULL; |
| 428 | | | } |
| 429 | | | } |
| |