citizenfx / fivem

The source code for the Cfx.re modification frameworks, such as FiveM, RedM and LibertyM, as well as FXServer.
https://cfx.re/
3.52k stars 2.07k forks source link

Clamp marker type index in FiveM #2564

Closed Disquse closed 4 months ago

Disquse commented 4 months ago

Goal of this PR

Using an invalid marker type index will cause an OOB crash. This PR is meant to fix this issue.

How is this PR achieving the goal

By replacing the original native handler with one that includes marker type index checks.

This PR applies to the following area(s)

FiveM, Natives

Successfully tested on

Game builds: 1604, 2060, 2189, 2372, 2545, 2612, 2699, 2802, 2944, 3095

Platforms: Windows, Linux

Checklist

Fixes issues

Addresses the problem reported in this forum topic: https://forum.cfx.re/t/drawmarker-causing-crash-when-you-enter-a-string-as-type-instead-of-a-integer/5236598