[Scummvm-git-logs] scummvm master -> 1daf70c746be5c346a11134d226ad52ed96a0e00

phcoder noreply at scummvm.org
Wed Feb 1 22:09:39 UTC 2023


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:
1daf70c746 BASE: Fix NPE when executable name is not available


Commit: 1daf70c746be5c346a11134d226ad52ed96a0e00
    https://github.com/scummvm/scummvm/commit/1daf70c746be5c346a11134d226ad52ed96a0e00
Author: Vladimir Serbinenko (phcoder at gmail.com)
Date: 2023-02-01T23:08:50+01:00

Commit Message:
BASE: Fix NPE when executable name is not available

Changed paths:
    base/main.cpp


diff --git a/base/main.cpp b/base/main.cpp
index 985790c8d0d..6e2b78c997a 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -418,7 +418,7 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) {
 	bool autodetect = false;
 
 	// Check for the autorun name
-	if (argv[0]) {
+	if (argc && argv && argv[0]) {
 		const char *s = strrchr(argv[0], '/');
 
 		if (!s)
@@ -444,7 +444,7 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) {
 		Common::String line;
 		Common::String res;
 
-		autorunArgs.push_back(argv[0]);
+		autorunArgs.push_back(argc && argv ? argv[0] : "");
 
 		if (autorun.open("scummvm-autorun")) {
 			while (!autorun.eos()) {




More information about the Scummvm-git-logs mailing list