From 02859be56d43bcece02aab350e02bc95ed1bf446 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Sun, 30 Sep 2012 01:10:57 +0200 Subject: Fix more undefined behavior caused by referencing the returned buffer by std::string::c_str() when the object is temporary See 83c7cc45daf6fb1f8c36f15297a4657e45a34e88 --- src/whois.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/whois.cpp') diff --git a/src/whois.cpp b/src/whois.cpp index 7ef79aa3f..bec9c7ea9 100644 --- a/src/whois.cpp +++ b/src/whois.cpp @@ -50,7 +50,8 @@ void InspIRCd::DoWhois(User* user, User* dest,unsigned long signon, unsigned lon } else { - this->SendWhoisLine(user, dest, 312, "%s %s %s :%s",user->nick.c_str(), dest->nick.c_str(), dest->server.c_str(), this->GetServerDescription(dest->server).c_str()); + std::string serverdesc = GetServerDescription(dest->server); + this->SendWhoisLine(user, dest, 312, "%s %s %s :%s",user->nick.c_str(), dest->nick.c_str(), dest->server.c_str(), serverdesc.c_str()); } if (IS_AWAY(dest)) -- cgit v1.2.3