From 9d760098a5a1bf5203fce8e3ba7b462a7885ee75 Mon Sep 17 00:00:00 2001 From: jackpoz Date: Wed, 14 May 2014 22:07:20 +0200 Subject: [PATCH] Core/Misc: Fix crash in ticket creation Fix a crash happening with malicious CMSG_GMTICKET_CREATE packets. --- src/server/game/Tickets/TicketMgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Tickets/TicketMgr.cpp b/src/server/game/Tickets/TicketMgr.cpp index b9ecfffb8c3..71d51153b4c 100644 --- a/src/server/game/Tickets/TicketMgr.cpp +++ b/src/server/game/Tickets/TicketMgr.cpp @@ -233,7 +233,7 @@ void GmTicket::SetChatLog(std::list time, std::string const& log) std::stringstream ss(log); std::stringstream newss; std::string line; - while (std::getline(ss, line)) + while (std::getline(ss, line) && !time.empty()) { newss << secsToTimeString(time.front()) << ": " << line << "\n"; time.pop_front();