[Scummvm-git-logs] scummvm master -> 9aafdcf976cb21691f5b0a6549cd7ddbe6b104ec

rvanlaar noreply at scummvm.org
Fri Oct 7 15:08:11 UTC 2022


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:
9aafdcf976 DIRECTOR: Fix unchecked return value


Commit: 9aafdcf976cb21691f5b0a6549cd7ddbe6b104ec
    https://github.com/scummvm/scummvm/commit/9aafdcf976cb21691f5b0a6549cd7ddbe6b104ec
Author: Roland van Laar (roland at rolandvanlaar.nl)
Date: 2022-10-07T17:05:46+02:00

Commit Message:
DIRECTOR: Fix unchecked return value

getChildren returns false when not succesful, i.e. meaning we can bail
out of the loop iteration.

Fixes COVERITY: 1462418

Changed paths:
    engines/director/util.cpp


diff --git a/engines/director/util.cpp b/engines/director/util.cpp
index de0691d4091..8d9fabea1fc 100644
--- a/engines/director/util.cpp
+++ b/engines/director/util.cpp
@@ -421,7 +421,9 @@ bool testPath(Common::String &path, bool directory) {
 		if (directory_list.empty() && !directory) {
 			mode = Common::FSNode::kListAll;
 		}
-		d.getChildren(fslist, mode);
+		bool hasChildren = d.getChildren(fslist, mode);
+		if (!hasChildren)
+			continue;
 
 		bool exists = false;
 		for (Common::FSList::iterator i = fslist.begin(); i != fslist.end(); ++i) {




More information about the Scummvm-git-logs mailing list