Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.13.2
-
f60cde61149655d004343ab97f18b3414871d75b
Description
When sorting a sparse array (SparseArrayData) with Array.sort, the engine crashes due to a nullpointer dereference:
const v3 = [1,2,3]; v3[10000] = 0; const v5 = v3.sort();
The root cause appears to be the call to thisObject->setArrayData(nullptr); in qv4arraydata.cpp:746. I am not quite sure why it is there (perhaps to reset the object's storage to set it up for the sorted elements?) - accessing the array data afterwards leads in order to sort the array leads to the crash.