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:
9b5efff
)
Fix a warning pointed by GCC 7.1
author
Loic Blot
<loic.blot@unix-experience.fr>
Thu, 18 May 2017 18:55:27 +0000
(20:55 +0200)
committer
Loic Blot
<loic.blot@unix-experience.fr>
Thu, 18 May 2017 18:55:27 +0000
(20:55 +0200)
lua_tonumber overflow in snprintf (12 bytes and only 10 can be written)
src/script/cpp_api/s_base.cpp
patch
|
blob
|
history
diff --git
a/src/script/cpp_api/s_base.cpp
b/src/script/cpp_api/s_base.cpp
index e72af22c6acdc8af17cd96bf2e872de5df00f848..4d7461c5ba5d3b30302b922a3876803da1921c48 100644
(file)
--- a/
src/script/cpp_api/s_base.cpp
+++ b/
src/script/cpp_api/s_base.cpp
@@
-240,7
+240,7
@@
void ScriptApiBase::stackDump(std::ostream &o)
break;
case LUA_TNUMBER: /* numbers */ {
char buf[10];
- snprintf(buf, 10, "%
g
", lua_tonumber(m_luastack, i));
+ snprintf(buf, 10, "%
lf
", lua_tonumber(m_luastack, i));
o << buf;
break;
}