(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-ismacryp.c) |
| |
| 258 | | | static void dissect_ismacryp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint ismacryp_version) |
| 259 | | | { |
| 260 | | | guint set_version; |
| 261 | | | proto_item *ismacryp_item; |
| 262 | | | proto_tree *ismacryp_tree; |
| 263 | | | proto_tree *ismacryp_message_tree; |
| 264 | | | |
| 265 | | | |
| 266 | | | if ((ismacryp_version!=version_type) && override_flag){ |
| 267 | | | |
| 268 | | | if (check_col(pinfo->cinfo, COL_INFO)){ |
| 269 | | | col_append_str(pinfo->cinfo, COL_INFO, " Manual version"); |
| 270 | | | } |
| 271 | | | set_version = version_type; |
| 272 | | | } |
| 273 | | | else { |
| 274 | | | set_version = ismacryp_version; |
| 275 | | | } |
| 276 | | | |
| 277 | | | if (set_version == V11){ |
| 278 | | | if (check_col(pinfo->cinfo, COL_PROTOCOL)) |
| 279 | | | col_set_str(pinfo->cinfo, COL_PROTOCOL, PROTO_TAG_ISMACRYP_11); |
| 280 | | | |
| 281 | | | if (pref_user_mode == FALSE){ |
| 282 | | | if (check_col( pinfo->cinfo, COL_INFO)) |
| 283 | | | col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",val_to_str(mode, modetypenames, "user mode")); |
| 284 | | | } |
| 285 | | | if (pref_user_mode == TRUE){ |
| 286 | | | if ( check_col( pinfo->cinfo, COL_INFO)) |
| 287 | | | col_append_fstr(pinfo->cinfo, COL_INFO, ", %s","user mode"); |
| 288 | | | } |
| 289 | | | user_mode = pref_user_mode; |
| 290 | | | } |
| 291 | | | if (set_version == V20){ |
| 292 | | | if (check_col(pinfo->cinfo, COL_PROTOCOL)) |
| 293 | | | col_set_str(pinfo->cinfo, COL_PROTOCOL, PROTO_TAG_ISMACRYP_20); |
| 294 | | | user_mode = TRUE; |
| 295 | | | |
| 296 | | | if (check_col( pinfo->cinfo, COL_INFO)) |
| 297 | | | col_append_fstr(pinfo->cinfo, COL_INFO, ", %s","user mode"); |
| 298 | | | } |
| 299 | | | |
| 300 | | | if (user_mode == TRUE){ |
| 301 | | | au_size_length = pref_au_size_length; |
| 302 | | | au_index_length = pref_au_index_length; |
| 303 | | | au_index_delta_length = pref_au_index_delta_length; |
| 304 | | | cts_delta_length = pref_cts_delta_length; |
| 305 | | | dts_delta_length = pref_dts_delta_length; |
| 306 | | | random_access_indication = pref_random_access_indication; |
| 307 | | | stream_state_indication = pref_stream_state_indication; |
| 308 | | | } |
| 309 | | | if (user_mode == FALSE){ |
| 310 | | | switch (mode){ |
| 311 | | | case AAC_HBR_MODE: |
| 312 | | | au_size_length = 13; |
| 313 | | | au_index_length = 3; |
| 314 | | | au_index_delta_length = 3; |
| 315 | | | cts_delta_length = 0; |
| 316 | | | dts_delta_length = 0; |
| 317 | | | random_access_indication = FALSE; |
| 318 | | | stream_state_indication = 0; |
| 319 | | | break; |
| 320 | | | case MPEG4_VIDEO_MODE: |
| 321 | | | au_size_length = 0; |
| 322 | | | au_index_length = 0; |
| 323 | | | au_index_delta_length = 0; |
| 324 | | | cts_delta_length = 0; |
| 325 | | | dts_delta_length = 22; |
| 326 | | | random_access_indication = TRUE; |
| 327 | | | stream_state_indication = 0; |
| 328 | | | break; |
| 329 | | | case AVC_VIDEO_MODE: |
| 330 | | | au_size_length = 0; |
| 331 | | | au_index_length = 0; |
| 332 | | | au_index_delta_length = 0; |
| 333 | | | cts_delta_length = 0; |
| 334 | | | dts_delta_length = 22; |
| 335 | | | random_access_indication = TRUE; |
| 336 | | | stream_state_indication = 0; |
| 337 | | | break; |
| 338 | | | default: |
| 339 | | | DISSECTOR_ASSERT_NOT_REACHED();
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
131 | #define DISSECTOR_ASSERT_NOT_REACHED() \ |
132 | (REPORT_DISSECTOR_BUG( \ |
133 | ep_strdup_printf("%s:%u: failed assertion \"DISSECTOR_ASSERT_NOT_REACHED\"", \ |
134 | __FILE__, __LINE__))) |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
106 | #define REPORT_DISSECTOR_BUG(message) \ |
107 | ((getenv("WIRESHARK_ABORT_ON_DISSECTOR_BUG") != NULL) ? \ |
108 | abort() : \ |
109 | THROW_MESSAGE(DissectorError, message)) |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/exceptions.h |
| |
226 | #define THROW_MESSAGE(x, y) \ |
227 | except_throw(XCEPT_GROUP_WIRESHARK, (x), (y)) |
| |
|
| 340 | | | break; |
Unreachable Control Flow
The highlighted code will not execute under any circumstances. This may be because of: |
|
| 341 | | | } |
| 342 | | | } |
| 343 | | | |
| 344 | | | |
| 345 | | | if (tree) |
| 346 | | | { |
| 347 | | | |
| 348 | | | |
| 349 | | | guint16 = 0; |
| 350 | | | guint16 totalbits =0; |
| 351 | | | int deltabits = -1; |
| 352 | | | guint16 totalbit_offset = 0; |
| 353 | | | int nbpadding_bits = 0; |
| 354 | | | offset_struct s_offset; |
| 355 | | | offset_struct* poffset; |
| 356 | | | guint16 nbmessage_bytes = 0; |
| 357 | | | s_offset.offset_bytes = 0; |
| 358 | | | s_offset.offset_bits = 0; |
| 359 | | | poffset = &s_offset; |
| 360 | | | |
| 361 | | | ismacryp_item = proto_tree_add_item(tree, proto_ismacryp, tvb, 0, -1, FALSE); |
| 362 | | | ismacryp_tree = proto_item_add_subtree(ismacryp_item, ett_ismacryp); |
| 363 | | | proto_item_append_text(tree, ", %s", "ismacryp packet"); |
| 364 | | | |
| 365 | | | |
| 366 | | | |
| 367 | | | |
| 368 | | | ismacryp_item = proto_tree_add_item(ismacryp_tree, , |
| 369 | | | tvb, poffset->offset_bytes, , FALSE ); |
| 370 | | | proto_item_append_text(ismacryp_item, " (bits)"); |
| 371 | | | =tvb_get_ntohs(tvb,poffset->offset_bytes); |
| 372 | | | poffset->offset_bytes+=; |
| 373 | | | |
| 374 | | | |
| 375 | | | |
| 376 | | | totalbits=(poffset->offset_bytes*8)+poffset->offset_bits; |
| 377 | | | while( ((totalbits-8*)<) && deltabits!=0 ) |
| 378 | | | { |
| 379 | | | poffset=( tvb, poffset, pinfo, ismacryp_tree, set_version); |
| 380 | | | deltabits=(poffset->offset_bytes*8)+poffset->offset_bits - totalbits; |
| 381 | | | totalbits+=deltabits; |
| 382 | | | } |
| 383 | | | |
| 384 | | | |
| 385 | | | |
| 386 | | | if ( (totalbits-8*) != ) |
| 387 | | | { |
| 388 | | | proto_item_append_text(ismacryp_item, |
| 389 | | | " Error - expected total AU size (%d bits) " |
| 390 | | | "does not match calculated size (%d bits) - check parameters!", |
| 391 | | | ,(totalbits-8*)); |
| 392 | | | } |
| 393 | | | |
| 394 | | | if (poffset->offset_bits!=0) |
| 395 | | | { |
| 396 | | | totalbit_offset = (poffset->offset_bytes)*8+poffset->offset_bits; |
| 397 | | | nbpadding_bits = (8-poffset->offset_bits); |
| 398 | | | ismacryp_item = proto_tree_add_bits_item(ismacryp_tree, hf_ismacryp_padding, |
| 399 | | | tvb, totalbit_offset, nbpadding_bits , FALSE); |
| 400 | | | proto_item_append_text(ismacryp_item, ": Length=%d bits",nbpadding_bits); |
| 401 | | | add_bits(poffset, nbpadding_bits); |
| 402 | | | } |
| 403 | | | |
| 404 | | | ismacryp_item = proto_tree_add_item( ismacryp_tree, hf_ismacryp_message, |
| 405 | | | tvb, poffset->offset_bytes, -1, FALSE ); |
| 406 | | | ismacryp_message_tree = proto_item_add_subtree(ismacryp_item, ett_ismacryp_message); |
| 407 | | | proto_item_append_text(ismacryp_item, ", %s", "Encrypted data"); |
| 408 | | | nbmessage_bytes = tvb_reported_length_remaining(tvb, poffset->offset_bytes); |
| 409 | | | proto_item_append_text(ismacryp_item, ", Length= %d bytes", nbmessage_bytes ); |
| 410 | | | |
| 411 | | | |
| 412 | | | if (ismacryp_message_tree) |
| 413 | | | { |
| 414 | | | poffset->offset_bytes+= nbmessage_bytes; |
| 415 | | | } |
| 416 | | | |
| 417 | | | } |
| 418 | | | } |
| |