Skip to content
Snippets Groups Projects
Commit b1ef8508 authored by sapier's avatar sapier Committed by kwolekr
Browse files

Fix possible 0 pointer access

parent 967121a3
No related branches found
No related tags found
No related merge requests found
...@@ -226,8 +226,10 @@ bool getstringfield(lua_State *L, int table, ...@@ -226,8 +226,10 @@ bool getstringfield(lua_State *L, int table,
if(lua_isstring(L, -1)){ if(lua_isstring(L, -1)){
size_t len = 0; size_t len = 0;
const char *ptr = lua_tolstring(L, -1, &len); const char *ptr = lua_tolstring(L, -1, &len);
result.assign(ptr, len); if (ptr) {
got = true; result.assign(ptr, len);
got = true;
}
} }
lua_pop(L, 1); lua_pop(L, 1);
return got; return got;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment