[Scummvm-git-logs] scummvm master -> 6caf974783dc977139e061b1e1624637c8ebcaef
orgads
noreply at scummvm.org
Wed May 14 15:58:11 UTC 2025
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
6caf974783 GRIM: Mark lua_error as noreturn
Commit: 6caf974783dc977139e061b1e1624637c8ebcaef
https://github.com/scummvm/scummvm/commit/6caf974783dc977139e061b1e1624637c8ebcaef
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2025-05-14T18:58:08+03:00
Commit Message:
GRIM: Mark lua_error as noreturn
and fix condition to avoid potential negative size passed to strncpy.
Changed paths:
engines/grim/lua/lstrlib.cpp
engines/grim/lua/lua.h
diff --git a/engines/grim/lua/lstrlib.cpp b/engines/grim/lua/lstrlib.cpp
index d7875a315d0..76a30f76805 100644
--- a/engines/grim/lua/lstrlib.cpp
+++ b/engines/grim/lua/lstrlib.cpp
@@ -93,7 +93,7 @@ static void push_captures(Capture *cap) {
for (int i = 0; i < cap->level; i++) {
int l = cap->capture[i].len;
char *buff = luaL_openspace(l+1);
- if (l == -1)
+ if (l < 0)
lua_error("unfinished capture");
strncpy(buff, cap->capture[i].init, l);
buff[l] = 0;
diff --git a/engines/grim/lua/lua.h b/engines/grim/lua/lua.h
index f450d7fd2ad..4590d544674 100644
--- a/engines/grim/lua/lua.h
+++ b/engines/grim/lua/lua.h
@@ -76,7 +76,7 @@ int32 lua_newtag();
int32 lua_copytagmethods(int32 tagto, int32 tagfrom);
void lua_settag(int32 tag); // In: object
-void lua_error(const char *s);
+void NORETURN_PRE lua_error(const char *s) NORETURN_POST;
int32 lua_dostring(const char *string); // Out: returns
int32 lua_dobuffer(const char *buff, int32 size, const char *name);
int32 lua_callfunction(lua_Object f);
More information about the Scummvm-git-logs
mailing list