From 318499350d80697be0563e2a43c2fc2df059c412 Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Tue, 12 Jun 2012 17:13:30 +0100 Subject: [PATCH] TPT: strncpy for loading sign text in OPS 433c1881bc --- src/client/GameSave.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/client/GameSave.cpp b/src/client/GameSave.cpp index ed541b2c5..7e3cdf861 100644 --- a/src/client/GameSave.cpp +++ b/src/client/GameSave.cpp @@ -308,8 +308,12 @@ void GameSave::readOPS(char * data, int dataLength) { if(strcmp(bson_iterator_key(&signiter), "text")==0 && bson_iterator_type(&signiter)==BSON_STRING) { - tempSign.text = bson_iterator_string(&signiter); + char tempString[256]; + strncpy(tempString, bson_iterator_string(&signiter), 255); + tempString[255] = 0; clean_text((char*)tempSign.text.c_str(), 158-14); + + tempSign.text = tempString; } else if(strcmp(bson_iterator_key(&signiter), "justification")==0 && bson_iterator_type(&signiter)==BSON_INT) {