-
-
Notifications
You must be signed in to change notification settings - Fork 837
possible crash: CONDITION_LIGHT division by zero #3047
Copy link
Copy link
Closed
Labels
Priority: LowMinor impactMinor impactStatus: Pending TestThis PR or Issue requires more testingThis PR or Issue requires more testingType: BugInconsistencies or issues which will cause an issue or problem for users or implementors.Inconsistencies or issues which will cause an issue or problem for users or implementors.
Metadata
Metadata
Assignees
Labels
Priority: LowMinor impactMinor impactStatus: Pending TestThis PR or Issue requires more testingThis PR or Issue requires more testingType: BugInconsistencies or issues which will cause an issue or problem for users or implementors.Inconsistencies or issues which will cause an issue or problem for users or implementors.
Priority
Low
Area
What happened?
Summary
I just discovered a very old bug that is present in ALL tfs-based engines, which means that Canary could be affected too
a little fun fact: OTServ doesn't have this bug (it was fixed somewhere around 2012 or earlier)
Steps to reproduce
Observed result
division by zero (server crash)
note: this screenshot was taken while debugging my own engine, but I've checked your code and it seems to have same bug

Line causing this
https://github.com/opentibiabr/canary/blob/main/src/creatures/combat/condition.cpp#L2508
possibly also:
https://github.com/opentibiabr/canary/blob/main/src/creatures/combat/condition.cpp#L2543
Solution
set minimum light level to 1 in the line I linked
What OS are you seeing the problem on?
Linux
Code of Conduct