util.datamanager: Fix not passing variables as format string to logger (thanks semgrep)
authorKim Alvefur <zash@zash.se>
Sat, 16 Jan 2021 15:49:46 +0100
changeset 11292 5fd1f1b544a0
parent 11291 b602dd3c4bbc
child 11293 c6965f3c321c
util.datamanager: Fix not passing variables as format string to logger (thanks semgrep) Passing error messages as format string could lead to errors, although not a problem anymore since util.format sanitizes this.
util/datamanager.lua
--- a/util/datamanager.lua	Sat Jan 16 00:24:06 2021 +0100
+++ b/util/datamanager.lua	Sat Jan 16 15:49:46 2021 +0100
@@ -344,7 +344,7 @@
 
 	local mode, err = lfs.attributes(store_dir, "mode");
 	if not mode then
-		return function() log("debug", err or (store_dir .. " does not exist")) end
+		return function() log("debug", "Could not iterate over stores in %s: %s", store_dir, err); end
 	end
 	local next, state = lfs.dir(store_dir); -- luacheck: ignore 431/next 431/state
 	return function(state) -- luacheck: ignore 431/state