lua: fix coverity issue with out of scope variable

Fix usage of out-of-scope variables. Introduced with the hashing
and adding the guard of g_disable_hashing.

To fix, just remove the guard so all variables are in scope. Hashes
are not initialized here so there is no need for the guard.
pull/5727/head
Jason Ish 5 years ago committed by Victor Julien
parent 1c68f4aed6
commit 512b0350a0

@ -757,7 +757,7 @@ static int LuaCallbackFileInfoPushToStackFromFile(lua_State *luastate, const Fil
char *md5ptr = NULL;
char *sha1ptr = NULL;
char *sha256ptr = NULL;
if (!g_disable_hashing) {
char md5[33] = "";
md5ptr = md5;
if (file->flags & FILE_MD5) {
@ -788,7 +788,6 @@ static int LuaCallbackFileInfoPushToStackFromFile(lua_State *luastate, const Fil
strlcat(sha256, one, sizeof(sha256));
}
}
}
lua_pushnumber(luastate, file->file_store_id);
lua_pushnumber(luastate, file->txid);

Loading…
Cancel
Save