[Scummvm-git-logs] scummvm master -> 0bdf49fb71baac25f8c9856cdf55ce3127271e5a

a-yyg 76591232+a-yyg at users.noreply.github.com
Fri Aug 13 13:51:52 UTC 2021


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
0bdf49fb71 SAGA2: Fix strlcpy range in document.cpp


Commit: 0bdf49fb71baac25f8c9856cdf55ce3127271e5a
    https://github.com/scummvm/scummvm/commit/0bdf49fb71baac25f8c9856cdf55ce3127271e5a
Author: a/ (yuri.kgpps at gmail.com)
Date: 2021-08-13T22:50:26+09:00

Commit Message:
SAGA2: Fix strlcpy range in document.cpp

Changed paths:
    engines/saga2/automap.cpp
    engines/saga2/document.cpp


diff --git a/engines/saga2/automap.cpp b/engines/saga2/automap.cpp
index 06686c1eaf..0a6296e2ab 100644
--- a/engines/saga2/automap.cpp
+++ b/engines/saga2/automap.cpp
@@ -258,7 +258,7 @@ bool CAutoMap::activate(gEventType why) {
 bool CAutoMap::keyStroke(gPanelMessage &msg) {
 	gEvent ev;
 	switch (msg.key) {
-		case Common::ASCII_ESCAPE:
+	case Common::ASCII_ESCAPE:
 		cmdAutoMapEsc(ev);
 		return true;
 	case Common::KEYCODE_HOME:
diff --git a/engines/saga2/document.cpp b/engines/saga2/document.cpp
index e88b6ece3f..55f7c7f530 100644
--- a/engines/saga2/document.cpp
+++ b/engines/saga2/document.cpp
@@ -162,13 +162,13 @@ CDocument::CDocument(CDocumentAppearance &dApp,
 	origText = new char[textSize + 1];
 
 	// and fill it
-	Common::strlcpy(origText, buffer, textSize);
+	Common::strlcpy(origText, buffer, textSize + 1);
 
 	// make a working buffer
 	text = new char[textSize + 1];
 
 	// and fill it
-	Common::strlcpy(text, origText, textSize);
+	Common::strlcpy(text, origText, textSize + 1);
 
 	textFont        = font;
 	textHeight      = (textFont ? textFont->height : 0);
@@ -465,7 +465,7 @@ bool CDocument::checkForImage(char      *string,
 
 void CDocument::makePages(void) {
 	// copy the original text back to the working buffer
-	Common::strlcpy(text, origText, textSize);
+	Common::strlcpy(text, origText, textSize + 1);
 
 
 	char    *str            = text;




More information about the Scummvm-git-logs mailing list