Page MenuHomeFeedback Tracker

Heap corruption when arguments to a function contain conditionals
New, NormalPublic

Description

When the arguments to a function call contain conditionals, this can corrupt the heap. From what I've seen, this can have the following side-effects for unrelated variables and instances:

  • ints, bools or floats changing value randomly
  • strings turning into random garbage
  • instances getting nulled/deleted or otherwise exhibiting unexpected behavior
  • segfault

Details

Severity
None
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Category
Modding
Steps To Reproduce

Example of a problematic function call

MyCustomFunction(arg1, arg2, condition1 || condition2);
Additional Information

Can be worked around in the following way

bool condArg;
if (condition1 || condition2)
    condArg = true;
MyCustomFunction(arg1, arg2, condArg);

Possibly relevant other ticket https://feedback.bistudio.com/T173348

Event Timeline

lava76 created this task.Tue, Jul 15, 6:08 PM
lava76 updated the task description. (Show Details)Tue, Jul 15, 6:15 PM
NATION added a subscriber: NATION.Tue, Jul 15, 8:29 PM