}
if ( !strcmp(svc_name, "http") )
- {
add_service_to_otn(sc, otn, "http2");
- svc_name = "http";
- }
if (otn->sigInfo.num_services >= sc->max_metadata_services)
{
OtnLookupAdd(sc->otn_map, otn);
if ( is_service_protocol(otn->snort_protocol_id) )
- add_service_to_otn(sc, otn, sc->proto_ref->get_name(otn->snort_protocol_id));
+ {
+ // copy required because the call to add_service_to_otn can
+ // invalidate the service name pointer
+ std::string service = sc->proto_ref->get_name(otn->snort_protocol_id);
+ add_service_to_otn(sc, otn, service.c_str());
+ }
/*
* The src/dst port parsing must be done before the Head Nodes are processed, since they must