
July 19, 2024. CrowdStrike pushes a tiny config update to its Falcon sensor. The file described 21 fields, but the sensor only had 20, so the code reached for one slot past the end of an array. That read happened inside the Windows kernel, so instead of a caught error it was an instant blue screen, 8.5 million machines at once: airlines grounded, hospitals, banks, checkouts frozen. All of it from reading one index too far. Put the bounds check back.
Objective
Read an array element only when the index is in range, the check CrowdStrike's update skipped.
Steps
$ read_at(arr, 20, 10)
10
$ read_at(arr, 20, 20)
-1
$ read_at(arr, 20, -1)
-1
Expected files
Allowed functions
None. Write every helper yourself.
Loading solutions...