diff options
author | kwolekr <kwolekr@minetest.net> | 2015-01-27 22:36:53 -0500 |
---|---|---|
committer | kwolekr <kwolekr@minetest.net> | 2015-01-27 22:36:53 -0500 |
commit | a8ec7876a68cb4abbf2d517526822f17d7ac0efc (patch) | |
tree | a3d7db13b6113d6a92ec5e86deb4d87d823409da /builtin | |
parent | ad690c46b10423b23d515bda0e89228b51f5b5e9 (diff) | |
download | minetest-a8ec7876a68cb4abbf2d517526822f17d7ac0efc.tar.gz minetest-a8ec7876a68cb4abbf2d517526822f17d7ac0efc.tar.bz2 minetest-a8ec7876a68cb4abbf2d517526822f17d7ac0efc.zip |
Prevent null concatenation when /deleteblocks is provided an incorrect format
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/game/chatcommands.lua | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/builtin/game/chatcommands.lua b/builtin/game/chatcommands.lua index 8ce1cfef5..2d94817e8 100644 --- a/builtin/game/chatcommands.lua +++ b/builtin/game/chatcommands.lua @@ -420,6 +420,10 @@ core.register_chatcommand("deleteblocks", { p2 = p1 else local pos1, pos2 = unpack(param:split(") (")) + if pos1 == nil or pos2 == nil then + return false, "Incorrect area format. Expected: (x1,y1,z1) (x2,y2,z2)" + end + p1 = core.string_to_pos(pos1 .. ")") p2 = core.string_to_pos("(" .. pos2) |