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

Fix to compile error in on_make_call_med_tp_complete while accessing calls array with invalid call id. #4144

Merged
merged 1 commit into from
Nov 11, 2024

Conversation

amubiera
Copy link
Contributor

Fixes compile warning/error on certain GCC versions using optimized -O2 builds:

pjsip/src/pjsua-lib/pjsua_call.c: In function 'on_make_call_med_tp_complete':
pjsip/src/pjsua-lib/pjsua_call.c:436:40: warning: array subscript -1 is below array bounds of 'pjsua_call[3]' [-Warray-bounds=]
  436 |     pjsua_call *call = &pjsua_var.calls[call_id];

call_id being invalid at this point should be impossible, but a particular ARM GCC version 13.2.1 does not detect that if (call_id == PJSUA_INVALID_ID) on line 861 of pjsua_call_make_call makes it impossible.

@sauwming sauwming merged commit 5259a21 into pjsip:master Nov 11, 2024
36 checks passed
@amubiera amubiera deleted the on-make-call-validate-call-id branch November 11, 2024 03:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants