Skip to content

possible crash: CONDITION_LIGHT division by zero #3047

@Zbizu

Description

@Zbizu

Priority

Low

Area

  • Datapack
  • Source
  • Map
  • Other

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

  1. change light level to 0 in utevo lux
  2. cast spell

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
obraz

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

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority: LowMinor impactStatus: Pending TestThis PR or Issue requires more testingType: BugInconsistencies or issues which will cause an issue or problem for users or implementors.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions