From: Mike Stepanek (mstepane) Date: Tue, 22 May 2018 19:50:20 +0000 (-0400) Subject: Merge pull request #1236 in SNORT/snort3 from appid_null_referer to master X-Git-Tag: 3.0.0-245~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8a06f7e2cd2b891068ff05cb090b36b6977a696d;p=thirdparty%2Fsnort3.git Merge pull request #1236 in SNORT/snort3 from appid_null_referer to master Squashed commit of the following: commit 6b32a70e6296eef35610e0789ba026e06d362f6c Author: Shravan Rangaraju Date: Tue May 22 19:31:32 2018 -0400 appid: create referer object only for non-null string --- diff --git a/src/network_inspectors/appid/appid_http_session.cc b/src/network_inspectors/appid/appid_http_session.cc index f2d889eda..b93504b2f 100644 --- a/src/network_inspectors/appid/appid_http_session.cc +++ b/src/network_inspectors/appid/appid_http_session.cc @@ -972,7 +972,8 @@ void AppIdHttpSession::update_referer(const uint8_t* new_referer, int32_t len) { if ( referer ) delete referer; - referer = new std::string((const char*)new_referer, len); + if ( new_referer and len ) referer = new std::string((const char*)new_referer, len); + else referer = nullptr; } void AppIdHttpSession::update_x_working_with(const uint8_t* new_xww, int32_t len)