From 9c3a37a790d21cfba8048d886776624f7c85eca9 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Fri, 27 Jan 2017 14:16:27 +0200 Subject: [PATCH] [Server] Make GetCellStateDescription's cstrDescription null-terminated --- apps/openmw-mp/Script/Functions/Cells.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/openmw-mp/Script/Functions/Cells.cpp b/apps/openmw-mp/Script/Functions/Cells.cpp index 55087822b..515054b56 100644 --- a/apps/openmw-mp/Script/Functions/Cells.cpp +++ b/apps/openmw-mp/Script/Functions/Cells.cpp @@ -27,7 +27,7 @@ const char *CellFunctions::GetCellStateDescription(unsigned short pid, unsigned string cellDescription = player->cellStateChanges.cells.at(i).getDescription(); static vector cstrDescription; - cstrDescription.reserve(cellDescription.size()); + cstrDescription.reserve(cellDescription.size() + 1); strncpy(&cstrDescription[0], cellDescription.c_str(), cstrDescription.capacity()); return &cstrDescription[0];