[Scummvm-git-logs] scummvm master -> 5b4559e5a6ffc02293b327064029ece979dbd85b

bluegr noreply at scummvm.org
Fri May 16 07:01:28 UTC 2025


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

Summary:
5b4559e5a6 SCUMM: Fix bad use of strncpy


Commit: 5b4559e5a6ffc02293b327064029ece979dbd85b
    https://github.com/scummvm/scummvm/commit/5b4559e5a6ffc02293b327064029ece979dbd85b
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2025-05-16T10:01:23+03:00

Commit Message:
SCUMM: Fix bad use of strncpy

strncpy doesn't ensure the string is null-terminated. Replace with
strlcpy.

Changed paths:
    engines/scumm/scumm.cpp


diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 2b83db350db..efb52b75c11 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -25,6 +25,7 @@
 #include "common/macresman.h"
 #include "common/md5.h"
 #include "common/events.h"
+#include "common/str.h"
 #include "common/system.h"
 #include "common/translation.h"
 
@@ -1294,7 +1295,7 @@ Common::Error ScummEngine::init() {
 			if (_game.id == macFileNames[i]._id) {
 				macScumm = true;
 
-				strncpy(filename, macFileNames[i]._name, sizeof(filename));
+				Common::strlcpy(filename, macFileNames[i]._name, sizeof(filename));
 
 				if (resource.exists(filename)) {
 					macResourceFile = filename;




More information about the Scummvm-git-logs mailing list