From: Sreeja Athirkandathil Narayanan (sathirka) Date: Tue, 29 Nov 2022 15:05:42 +0000 (+0000) Subject: Pull request #3678: appid: Fixed addition of duplicate entries in app_info_table X-Git-Tag: 3.1.48.0~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=26ad5dbd07016e536cb16154ae2b4c65564748a6;p=thirdparty%2Fsnort3.git Pull request #3678: appid: Fixed addition of duplicate entries in app_info_table Merge in SNORT/snort3 from ~BSACHDEV/snort3:apptablefix to master Squashed commit of the following: commit 51e60c3e20024038a9c24366aca543730f21293b Author: bsachdev Date: Wed Nov 23 12:40:45 2022 -0500 appid: Fixed addition of duplicate entries in app_info_table --- diff --git a/src/network_inspectors/appid/app_info_table.cc b/src/network_inspectors/appid/app_info_table.cc index 4cc357126..3f66b37c8 100644 --- a/src/network_inspectors/appid/app_info_table.cc +++ b/src/network_inspectors/appid/app_info_table.cc @@ -720,21 +720,22 @@ void AppInfoManager::init_appid_info_table(const AppIdConfig& config, if (token) entry->snort_protocol_id = add_appid_protocol_reference(token, sc); - if ((app_id = get_static_app_info_entry(entry->appId))) - { - app_info_table[app_id] = entry; - AppIdPegCounts::add_app_peg_info(entry->app_name_key, app_id); - } - - if ((app_id = get_static_app_info_entry(entry->serviceId))) - app_info_service_table[app_id] = entry; - if ((app_id = get_static_app_info_entry(entry->clientId))) - app_info_client_table[app_id] = entry; - if ((app_id = get_static_app_info_entry(entry->payloadId))) - app_info_payload_table[app_id] = entry; - if (!add_entry_to_app_info_name_table(entry->app_name_key, entry)) delete entry; + else + { + if ((app_id = get_static_app_info_entry(entry->appId))) + { + app_info_table[app_id] = entry; + AppIdPegCounts::add_app_peg_info(entry->app_name_key, app_id); + } + if ((app_id = get_static_app_info_entry(entry->serviceId))) + app_info_service_table[app_id] = entry; + if ((app_id = get_static_app_info_entry(entry->clientId))) + app_info_client_table[app_id] = entry; + if ((app_id = get_static_app_info_entry(entry->payloadId))) + app_info_payload_table[app_id] = entry; + } } fclose(tableFile);