(/home/sate/Testcases/c/cve/wireshark-1.2.0/plugins/mate/mate_setup.c) |
| |
| 571 | | | extern mate_config* mate_make_config(const gchar* filename, int mate_hfid) { |
| 572 | | | gint* ett; |
| 573 | | | avp_init(); |
| 574 | | | |
| 575 | | | matecfg = g_malloc(sizeof(mate_config)); |
| 576 | | | |
| 577 | | | matecfg->hfid_mate = mate_hfid; |
| 578 | | | |
| 579 | | | matecfg->fields_filter = g_string_new(""); |
| 580 | | | matecfg->protos_filter = g_string_new(""); |
| 581 | | | |
| 582 | | | matecfg->dbg_facility = NULL; |
| 583 | | | |
| 584 | | | matecfg->mate_lib_path = g_strdup_printf("%s%c%s%c",get_datafile_dir(),DIR_SEP,DEFAULT_MATE_LIB_PATH,DIR_SEP);; |
| 585 | | | |
| 586 | | | matecfg->pducfgs = g_hash_table_new(g_str_hash,g_str_equal); |
Useless Assignment
This code assigns the variable the same value it already had. |
|
| 587 | | | matecfg->gopcfgs = g_hash_table_new(g_str_hash,g_str_equal); |
| 588 | | | matecfg->gogcfgs = g_hash_table_new(g_str_hash,g_str_equal); |
| 589 | | | matecfg->transfs = g_hash_table_new(g_str_hash,g_str_equal); |
| 590 | | | |
| 591 | | | matecfg->pducfglist = g_ptr_array_new(); |
| 592 | | | matecfg->gops_by_pduname = g_hash_table_new(g_str_hash,g_str_equal); |
| 593 | | | matecfg->gogs_by_gopname = g_hash_table_new(g_str_hash,g_str_equal); |
| 594 | | | |
| 595 | | | matecfg->ett_root = -1; |
| 596 | | | |
| 597 | | | matecfg->hfrs = g_array_new(FALSE,FALSE,sizeof(hf_register_info)); |
| 598 | | | matecfg->ett = g_array_new(FALSE,FALSE,sizeof(gint*)); |
| 599 | | | |
| 600 | | | matecfg->defaults.pdu.drop_unassigned = FALSE; |
| 601 | | | matecfg->defaults.pdu.discard = FALSE; |
| 602 | | | matecfg->defaults.pdu. = FALSE; |
| 603 | | | matecfg->defaults.pdu.match_mode = AVPL_STRICT; |
| 604 | | | matecfg->defaults.pdu.replace_mode = AVPL_INSERT; |
| 605 | | | |
| 606 | | | matecfg->defaults.gop.expiration = -1.0; |
| 607 | | | matecfg->defaults.gop.idle_timeout = -1.0; |
| 608 | | | matecfg->defaults.gop.lifetime = -1.0; |
| 609 | | | matecfg->defaults.gop.pdu_tree_mode = GOP_FRAME_TREE; |
| 610 | | | matecfg->defaults.gop.show_times = TRUE; |
| 611 | | | matecfg->defaults.gop.drop_unassigned = FALSE; |
| 612 | | | |
| 613 | | | |
| 614 | | | matecfg->defaults.gog.expiration = 5.0; |
| 615 | | | matecfg->defaults.gog.gop_tree_mode = GOP_BASIC_TREE; |
| 616 | | | |
| 617 | | | |
| 618 | | | matecfg->dbg_lvl = 0; |
| 619 | | | matecfg->dbg_pdu_lvl = 0; |
| 620 | | | matecfg->dbg_gop_lvl = 0; |
| 621 | | | matecfg->dbg_gog_lvl = 0; |
| 622 | | | |
| 623 | | | matecfg->config_error = g_string_new(""); |
| 624 | | | |
| 625 | | | ett = &matecfg->ett_root; |
| 626 | | | g_array_append_val(matecfg->ett,ett);
x /usr/include/glib-2.0/glib/garray.h |
| |
65 | #define g_array_append_val(a,v) g_array_append_vals (a, &(v), 1) |
| |
|
| 627 | | | |
| 628 | | | if ( mate_load_config(filename,matecfg) ) { |
| 629 | | | analyze_config(); |
| 630 | | | } else { |
| 631 | | | report_failure("MATE failed to configure!\n" |
| 632 | | | "It is recommended that you fix your config and restart Wireshark.\n" |
| 633 | | | "The reported error is:\n%s\n",matecfg->config_error->str); |
| 634 | | | |
| 635 | | | |
| 636 | | | matecfg = NULL; |
| 637 | | | return NULL; |
| 638 | | | } |
| 639 | | | |
| 640 | | | if (matecfg->fields_filter->len > 1) { |
| 641 | | | g_string_erase(matecfg->fields_filter,0,2); |
| 642 | | | g_string_erase(matecfg->protos_filter,0,2); |
| 643 | | | } else { |
| 644 | | | |
| 645 | | | matecfg = NULL; |
| 646 | | | return NULL; |
| 647 | | | } |
| 648 | | | |
| 649 | | | matecfg->tap_filter = g_strdup_printf("(%s) && (%s)",matecfg->protos_filter->str,matecfg->fields_filter->str); |
| 650 | | | |
| 651 | | | return matecfg; |
| 652 | | | } |
| |