(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-radius.c) |
| |
| 1762 | | | extern void radius_register_avp_dissector(guint32 vendor_id, guint32 attribute_id, radius_avp_dissector_t radius_avp_dissector) { |
| 1763 | | | radius_vendor_info_t* vendor; |
| 1764 | | | radius_attr_info_t* dictionary_entry; |
| 1765 | | | GHashTable* by_id; |
| 1766 | | | |
| 1767 | | | DISSECTOR_ASSERT(radius_avp_dissector != NULL);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
117 | #define DISSECTOR_ASSERT(expression) \ |
118 | ((void) ((expression) ? (void)0 : \ |
119 | __DISSECTOR_ASSERT (expression, __FILE__, __LINE__))) |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
138 | #define __DISSECTOR_ASSERT(expression, file, lineno) \ |
139 | (REPORT_DISSECTOR_BUG( \ |
140 | ep_strdup_printf("%s:%u: failed assertion \"%s\"", \ |
141 | file, lineno, __DISSECTOR_ASSERT_STRINGIFY(expression)))) |
| |
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)) |
| |
|
| 1768 | | | |
| 1769 | | | if (vendor_id) { |
| 1770 | | | vendor = g_hash_table_lookup(dict->vendors_by_id,GUINT_TO_POINTER(vendor_id)); |
| 1771 | | | |
| 1772 | | | if ( ! vendor ) { |
| 1773 | | | vendor = g_malloc(sizeof(radius_vendor_info_t)); |
| 1774 | | | |
| 1775 | | | vendor->name = g_strdup_printf("%s-%u",val_to_str(vendor_id, sminmpec_values, "Unknown"),vendor_id); |
| 1776 | | | vendor->code = vendor_id; |
| 1777 | | | vendor->attrs_by_id = g_hash_table_new(g_direct_hash,g_direct_equal); |
Useless Assignment
This code assigns the variable the same value it already had. |
|
| 1778 | | | vendor->ett = no_vendor.ett; |
| 1779 | | | |
| 1780 | | | g_hash_table_insert(dict->vendors_by_id,GUINT_TO_POINTER(vendor->code),vendor); |
| 1781 | | | g_hash_table_insert(dict->vendors_by_name,(gpointer)(vendor->name),vendor); |
| 1782 | | | } |
| 1783 | | | |
| 1784 | | | dictionary_entry = g_hash_table_lookup(vendor->attrs_by_id,GUINT_TO_POINTER(attribute_id)); |
| 1785 | | | by_id = vendor->attrs_by_id; |
| 1786 | | | } else { |
| 1787 | | | dictionary_entry = g_hash_table_lookup(dict->attrs_by_id,GUINT_TO_POINTER(attribute_id)); |
| 1788 | | | by_id = dict->attrs_by_id; |
| 1789 | | | } |
| 1790 | | | |
| 1791 | | | if (!dictionary_entry) { |
| 1792 | | | dictionary_entry = g_malloc(sizeof(radius_attr_info_t));; |
| 1793 | | | |
| 1794 | | | dictionary_entry->name = g_strdup_printf("Unknown-Attribute-%u",attribute_id); |
| 1795 | | | dictionary_entry->code = attribute_id; |
| 1796 | | | dictionary_entry->encrypt = FALSE; |
| 1797 | | | dictionary_entry->type = NULL; |
| 1798 | | | dictionary_entry->vs = NULL; |
| 1799 | | | dictionary_entry->hf = no_dictionary_entry.hf; |
| 1800 | | | dictionary_entry->tagged = 0; |
| 1801 | | | dictionary_entry->hf_tag = -1; |
| 1802 | | | dictionary_entry->hf_len = no_dictionary_entry.hf_len; |
| 1803 | | | dictionary_entry->ett = no_dictionary_entry.ett; |
| 1804 | | | |
| 1805 | | | g_hash_table_insert(by_id,GUINT_TO_POINTER(dictionary_entry->code),dictionary_entry); |
| 1806 | | | } |
| 1807 | | | |
| 1808 | | | dictionary_entry->dissector = radius_avp_dissector; |
| 1809 | | | |
| 1810 | | | } |
| |