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

check malloc return value for NULL and update docs #361

Merged
merged 1 commit into from
Sep 29, 2024

Conversation

ZXShady
Copy link
Contributor

@ZXShady ZXShady commented Sep 28, 2024

sfFtpDirectoryResponse_getDirectory can fail and return NULL becuase 'strdup' returns null on failure and it didn't mention it in the docs but sfFtpDirectoryResponse_getDirectoryUnicode didn't and just had UB due not checking return value of malloc.

typing NULL instead of nullptr in the docs made me age 30 years btw

@ZXShady ZXShady force-pushed the check_malloc_return_value branch 2 times, most recently from 3ebcabc to 91b499e Compare September 29, 2024 16:54
`sfFtpDirectoryResponse_getDirectory` can fail and return NULL becuase 'strdup' returns null on failure but `sfFtpDirectoryResponse_getDirectoryUnicode` didn't and just had UB due not checking return value of malloc.

typing NULL in the docs made me age 30 years btw
@ChrisThrasher ChrisThrasher merged commit 66e7af4 into SFML:master Sep 29, 2024
39 checks passed
@eXpl0it3r eXpl0it3r added this to the 3.0 milestone Sep 29, 2024
@ZXShady ZXShady deleted the check_malloc_return_value branch October 2, 2024 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants