summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPilzAdam <pilzadam@minetest.net>2013-12-09 22:39:24 +0100
committerPilzAdam <pilzadam@minetest.net>2013-12-09 22:39:24 +0100
commit6c4a8766ab1f9ca6acb9e00bdfb275ffcd226bc0 (patch)
treeb5a60a68d9e389dc3a0dd2ec41d01374b05b97dc /src
parentdae03382bf1e3abfcc33417c611b9194c7783b3f (diff)
downloadminetest-6c4a8766ab1f9ca6acb9e00bdfb275ffcd226bc0.tar.gz
minetest-6c4a8766ab1f9ca6acb9e00bdfb275ffcd226bc0.tar.bz2
minetest-6c4a8766ab1f9ca6acb9e00bdfb275ffcd226bc0.zip
Check if width, height or start index of a list[] is negative
Diffstat (limited to 'src')
-rw-r--r--src/guiFormSpecMenu.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/guiFormSpecMenu.cpp b/src/guiFormSpecMenu.cpp
index 920a7f1f2..82def7411 100644
--- a/src/guiFormSpecMenu.cpp
+++ b/src/guiFormSpecMenu.cpp
@@ -421,6 +421,12 @@ void GUIFormSpecMenu::parseList(parserData* data,std::string element) {
s32 start_i = 0;
if(startindex != "")
start_i = stoi(startindex);
+
+ if (geom.X < 0 || geom.Y < 0 || start_i < 0) {
+ errorstream<< "Invalid list element: '" << element << "'" << std::endl;
+ return;
+ }
+
if(data->bp_set != 2)
errorstream<<"WARNING: invalid use of list without a size[] element"<<std::endl;
m_inventorylists.push_back(ListDrawSpec(loc, listname, pos, geom, start_i));