Skip to content

Commit

Permalink
Fix: add missing NULL ptr check
Browse files Browse the repository at this point in the history
  • Loading branch information
jcorporation committed May 16, 2024
1 parent 4c94a14 commit 2797ed8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/scripts/interface_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ int lua_util_hash(lua_State *lua_vm) {
const char *str = lua_tostring(lua_vm, 1);
const char *alg = lua_tostring(lua_vm, 2);

if (str == NULL) {
if (str == NULL ||
alg == NULL)
{
MYMPD_LOG_ERROR(NULL, "Lua - util_hash: NULL string");
return luaL_error(lua_vm, "NULL string");
}
Expand Down

0 comments on commit 2797ed8

Please sign in to comment.