Skip to content

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
@ZXShady ZXShady force-pushed the check_malloc_return_value branch from 91b499e to 0efbfe0 Compare September 29, 2024 17:02
@ChrisThrasher ChrisThrasher merged commit 66e7af4 into SFML:master Sep 29, 2024
@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