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(ijkplayer): fix address overflow #5524

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

th1nk3r-ing
Copy link

It would cause overflow when the highest bit of the address is 1. So, we should using strtoull, not strtoll

It would cause overflow when the highest bit of the address is 1.
So, we should using `strtoull`, not `strtoll`
@th1nk3r-ing
Copy link
Author

The test code is :

int main(void)
{
    const char *pStr = "0xb400007896140dc0";
    uint64_t out = strtoull(pStr, NULL, 0);
    uint64_t out1 = strtoll(pStr, NULL, 0);

    printf("[%s %d] pStr:[%s], strtoll:[0x%"PRIx64"], strtoull:[0x%"PRIx64"]",
        __func__, __LINE__, pStr, out1, out);
    return 0;
}

result : [main 13] pStr:[0xb400007896140dc0], strtoll:[0x7fffffffffffffff], strtoull:[0xb400007896140dc0]

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

Successfully merging this pull request may close these issues.

None yet

1 participant