Skip to content

Conversation

akien-mga
Copy link
Member

The error check was added for FileAccessUnix but it's not an error when both
p_src and p_length are zero.

Added correct error checks to all implementations to prevent the actual
erroneous case: p_src is nullptr but p_length > 0 (risk of null pointer
indexing).

Fixes #33564.

(Congrats @qarmin for reporting a bug you created :P 9ddb326)

The error check was added for `FileAccessUnix` but it's not an error when both
`p_src` and `p_length` are zero.

Added correct error checks to all implementations to prevent the actual
erroneous case: `p_src` is nullptr but `p_length > 0` (risk of null pointer
indexing).

Fixes godotengine#33564.
@akien-mga akien-mga added bug topic:core cherrypick:3.x Considered for cherry-picking into a future 3.x release cherrypick:3.3 labels Jun 7, 2021
@akien-mga akien-mga added this to the 4.0 milestone Jun 7, 2021
@akien-mga akien-mga requested review from Faless and RandomShaper June 7, 2021 16:35
@akien-mga akien-mga requested review from a team as code owners June 7, 2021 16:35
@akien-mga akien-mga merged commit d92e462 into godotengine:master Jun 7, 2021
@akien-mga akien-mga deleted the fileaccess-store_buffer-err-len-0 branch June 7, 2021 20:33
@akien-mga
Copy link
Member Author

Cherry-picked for 3.4.

@akien-mga akien-mga removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Jun 7, 2021
@akien-mga
Copy link
Member Author

Cherry-picked for 3.3.3.

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.

ERROR: store_buffer: Condition ' !p_src ' is true when doing some operations.
2 participants