samp-plugin-timerfix
samp-plugin-timerfix copied to clipboard
Array lengths not checked in any way
Arrays should be followed by a length, which should be specified by i
. However, nothing in the code checks that the correct specifier is used, if one is used at all:
SetTimerEx("Func", 1000, 0, "af", array, unrelatedFloat); // Probably a stupid size as an int.
SetTimerEx("Func", 1000, 0, "a", array); // Not even enough parameters.
SetTimerEx("Func", 1000, 0, "aai", array, array, 4); // Second array is somehow first array's size.
SetTimerEx("Func", 1000, 0, "ai", array, -1); // -1 given straight to "malloc" with no sanity checks.
SetTimerEx("Func", 1000, 0, "ai", array, cellmax); // Same, try allocate 8Gb.
What is the maximum array size can be passed?