From 00ec79d1ad4d30c01d174d6cda608de59b3a201f Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Sat, 6 Oct 2012 23:49:47 +0200 Subject: m_spanningtree Fix undefined behavior caused by referencing the returned buffer by std::string::c_str() when the object is temporary --- src/modules/m_spanningtree/netburst.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/modules/m_spanningtree/netburst.cpp b/src/modules/m_spanningtree/netburst.cpp index 9e6c07425..5248ea897 100644 --- a/src/modules/m_spanningtree/netburst.cpp +++ b/src/modules/m_spanningtree/netburst.cpp @@ -34,8 +34,9 @@ */ void TreeSocket::DoBurst(TreeServer* s) { + std::string servername = s->GetName(); ServerInstance->SNO->WriteToSnoMask('l',"Bursting to \2%s\2 (Authentication: %s%s).", - s->GetName().c_str(), + servername.c_str(), capab->auth_fingerprint ? "SSL Fingerprint and " : "", capab->auth_challenge ? "challenge-response" : "plaintext password"); this->CleanNegotiationInfo(); -- cgit v1.2.3