Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tracerCount is missing in several calls to EV_HLDM_FireBullets. #3184

Open
malortie opened this issue Dec 5, 2021 · 0 comments
Open

tracerCount is missing in several calls to EV_HLDM_FireBullets. #3184

malortie opened this issue Dec 5, 2021 · 0 comments

Comments

@malortie
Copy link

malortie commented Dec 5, 2021

The two lines below do not pass &tracerCount[idx - 1] when calling EV_HLDM_FireBullets.

EV_HLDM_FireBullets( idx, forward, right, up, 1, vecSrc, vecAiming, 8192, BULLET_PLAYER_9MM, 0, 0, args->fparam1, args->fparam2 );

EV_HLDM_FireBullets( idx, forward, right, up, 1, vecSrc, vecAiming, 8192, BULLET_PLAYER_357, 0, 0, args->fparam1, args->fparam2 );

The code can crash with a null pointer exception if iTracerFreq different from 0 and tracerCount is unspecified.

if ( iTracerFreq != 0 && ( (*tracerCount)++ % iTracerFreq) == 0 )

&tracerCount[idx - 1] should always be passed so that it points to a valid memory location.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant