(/home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/decode_as_dlg.c) |
| |
| 310 | | | decode_build_show_list (const gchar *table_name, ftenum_t selector_type, |
| 311 | | | gpointer key, gpointer value, gpointer user_data) |
| 312 | | | { |
| 313 | | | dissector_handle_t current, initial; |
| 314 | | | const gchar *current_proto_name, *initial_proto_name; |
| 315 | | | gchar *selector_name; |
| 316 | | | gchar string1[20]; |
| 317 | | | |
| 318 | | | g_assert(user_data);
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__)) |
| |
|
| 319 | | | g_assert(value);
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__)) |
| |
|
| 320 | | | |
| 321 | | | current = dtbl_entry_get_handle(value); |
| 322 | | | if (current == NULL) |
| 323 | | | current_proto_name = "(none)"; |
| 324 | | | else |
| 325 | | | current_proto_name = dissector_handle_get_short_name(current); |
| 326 | | | initial = dtbl_entry_get_initial_handle(value); |
| 327 | | | if (initial == NULL) |
| 328 | | | initial_proto_name = "(none)"; |
| 329 | | | else |
| 330 | | | initial_proto_name = dissector_handle_get_short_name(initial); |
| 331 | | | |
| 332 | | | switch (selector_type) { |
| 333 | | | |
| 334 | | | case FT_UINT8: |
| 335 | | | case FT_UINT16: |
| 336 | | | case FT_UINT24: |
| 337 | | | case FT_UINT32: |
| 338 | | | switch (get_dissector_table_base(table_name)) { |
| 339 | | | |
| 340 | | | case BASE_DEC: |
| 341 | | | g_snprintf(string1, sizeof(string1), "%u", GPOINTER_TO_UINT(key)); |
| 342 | | | break; |
| 343 | | | |
| 344 | | | case BASE_HEX: |
| 345 | | | switch (get_dissector_table_selector_type(table_name)) { |
| 346 | | | |
| 347 | | | case FT_UINT8: |
| 348 | | | g_snprintf(string1, sizeof(string1), "0x%02x", GPOINTER_TO_UINT(key)); |
| 349 | | | break; |
| 350 | | | |
| 351 | | | case FT_UINT16: |
| 352 | | | g_snprintf(string1, sizeof(string1), "0x%04x", GPOINTER_TO_UINT(key)); |
| 353 | | | break; |
| 354 | | | |
| 355 | | | case FT_UINT24: |
| 356 | | | g_snprintf(string1, sizeof(string1), "0x%06x", GPOINTER_TO_UINT(key)); |
| 357 | | | break; |
| 358 | | | |
| 359 | | | case FT_UINT32: |
| 360 | | | g_snprintf(string1, sizeof(string1), "0x%08x", GPOINTER_TO_UINT(key)); |
| 361 | | | break; |
| 362 | | | |
| 363 | | | default: |
| 364 | | | g_assert_not_reached();
x /usr/include/glib-2.0/glib/gtestutils.h |
| |
73 | #define g_assert_not_reached() do { g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, NULL); } while (0) |
| |
x /usr/include/glib-2.0/glib/gmacros.h |
| |
160 | # define G_STRFUNC ((const char*) (__PRETTY_FUNCTION__)) |
| |
|
| 365 | | | break; |
| 366 | | | } |
| 367 | | | break; |
| 368 | | | |
| 369 | | | case BASE_OCT: |
| 370 | | | g_snprintf(string1, sizeof(string1), "%#o", GPOINTER_TO_UINT(key)); |
| 371 | | | break; |
| 372 | | | } |
| 373 | | | selector_name = string1; |
| 374 | | | break; |
| 375 | | | |
| 376 | | | case FT_STRING: |
| 377 | | | case FT_STRINGZ: |
| 378 | | | selector_name = key; |
| 379 | | | break; |
| 380 | | | |
| 381 | | | default: |
| 382 | | | g_assert_not_reached();
x /usr/include/glib-2.0/glib/gtestutils.h |
| |
73 | #define g_assert_not_reached() do { g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, NULL); } while (0) |
| |
x /usr/include/glib-2.0/glib/gmacros.h |
| |
160 | # define G_STRFUNC ((const char*) (__PRETTY_FUNCTION__)) |
| |
|
| 383 | | | selector_name = NULL; |
Unreachable Computation
The highlighted code will not execute under any circumstances. This may be because of: |
|
| 384 | | | break; |
| 385 | | | } |
| 386 | | | |
| 387 | | | decode_add_to_show_list ( |
| 388 | | | user_data, |
| 389 | | | get_dissector_table_ui_name(table_name), |
| 390 | | | selector_name, |
| 391 | | | initial_proto_name, |
| 392 | | | current_proto_name); |
| 393 | | | } |
| |