projects
/
oweals
/
minetest.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
967121a
)
Fix possible 0 pointer access
author
sapier
<Sapier at GMX dot net>
Sun, 23 Jun 2013 14:09:02 +0000
(16:09 +0200)
committer
kwolekr
<kwolekr@minetest.net>
Wed, 3 Jul 2013 00:01:48 +0000
(20:01 -0400)
src/script/common/c_converter.cpp
patch
|
blob
|
history
diff --git
a/src/script/common/c_converter.cpp
b/src/script/common/c_converter.cpp
index 65c3654ae29154a20a209ecde84ec06691022452..df86f2dafe1bff067b71d6d0c58cbf8a3837cf86 100644
(file)
--- a/
src/script/common/c_converter.cpp
+++ b/
src/script/common/c_converter.cpp
@@
-226,8
+226,10
@@
bool getstringfield(lua_State *L, int table,
if(lua_isstring(L, -1)){
size_t len = 0;
const char *ptr = lua_tolstring(L, -1, &len);
- result.assign(ptr, len);
- got = true;
+ if (ptr) {
+ result.assign(ptr, len);
+ got = true;
+ }
}
lua_pop(L, 1);
return got;