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

[core] CodeQL: operation requires 22 bytes. #2629

Merged

Conversation

maxsharabayko
Copy link
Collaborator

CodeQL reports (#2578):

This 'call to sprintf' operation requires 22 bytes but the destination is only 20 bytes.

Not sure where 22 bytes come from though.
I assume the longest would be SrtVersionString(-2147483647) = -32767.-255.-255 which is 17 characters.

// int version max 2147483647, min -2147483648.
int patch = version % 0x100; // max 255   min -255
int minor = (version/0x100)%0x100; // max 255, min -255.
int major = version/0x10000; // max 127.  min -32767

@maxsharabayko maxsharabayko added Type: Maintenance Work required to maintain or clean up the code [core] Area: Changes in SRT library core labels Jan 25, 2023
@maxsharabayko maxsharabayko added this to the v1.5.2 milestone Jan 25, 2023
@maxsharabayko maxsharabayko merged commit 64dedef into Haivision:master Jan 26, 2023
@maxsharabayko maxsharabayko deleted the hotfix/version-buf-len branch January 26, 2023 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[core] Area: Changes in SRT library core Type: Maintenance Work required to maintain or clean up the code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant