Skip to content

Commit b1ef850

Browse files
sapierkwolekr
sapier
authored andcommittedJul 3, 2013
Fix possible 0 pointer access
1 parent 967121a commit b1ef850

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎src/script/common/c_converter.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,10 @@ bool getstringfield(lua_State *L, int table,
226226
if(lua_isstring(L, -1)){
227227
size_t len = 0;
228228
const char *ptr = lua_tolstring(L, -1, &len);
229-
result.assign(ptr, len);
230-
got = true;
229+
if (ptr) {
230+
result.assign(ptr, len);
231+
got = true;
232+
}
231233
}
232234
lua_pop(L, 1);
233235
return got;

0 commit comments

Comments
 (0)
Please sign in to comment.