URL:
<http://gna.org/bugs/?24223>
Summary: OOS Caused by luaL_checkinteger
Project: Battle for Wesnoth
Submitted by: gfgtdf
Submitted on: Di 22 Dez 2015 13:58:52 UTC
Category: Bug
Severity: 5 - Blocker
Priority: 5 - Normal
Item Group: None of the others
Status: None
Privacy: Public
Assigned to: None
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: 1.13.x,1.12.x
Operating System: all
_______________________________________________________
Details:
this code:
[gold]
side=1
amount= 10.7
[/gold]
Causes OOS, the reason is that the 10.7 is casted to an integer with
luaL_checkinteger, which does this in an undefined way. And in fact this code
gives 10 gold on some machines/compilers/operating systems and 11 gold on
other machines.
Sure people usually wouldn't use [gold] like that directly, but for example
codes like below which gives side 1 gold dependent ona the number of sides and
the number of villages on the map, can casue the smae bug if there are 19
villages on the map and 4 players.
{VARIABLE amount $num_villages}
{VARIABLE_OP amount divide $num_players}
[gold]
side=1
amount=$amount
[/gold]
OOS becasue of this were already observed in the mp campaign "World Conquest"
on the default mp server.
_______________________________________________________
Reply to this item at:
<http://gna.org/bugs/?24223>
_______________________________________________
Nachricht gesendet von/durch Gna!
http://gna.org/
_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs