Skip to content

config_file: check result of git_array_alloc#5053

Merged
ethomson merged 1 commit intolibgit2:masterfrom
tniessen:cf-check-array-alloc-result
Apr 16, 2019
Merged

config_file: check result of git_array_alloc#5053
ethomson merged 1 commit intolibgit2:masterfrom
tniessen:cf-check-array-alloc-result

Conversation

@tniessen
Copy link
Contributor

git_array_alloc can return NULL if no memory is available, causing a segmentation fault in memset. This adds GIT_ERROR_CHECK_ALLOC similar to how other parts of the code base deal with the return value of git_array_alloc.

This is my first contribution to libgit2, please let me know if I made a mistake.

git_array_alloc can return NULL if no memory is available, causing
a segmentation fault in memset. This adds GIT_ERROR_CHECK_ALLOC
similar to how other parts of the code base deal with the return
value of git_array_alloc.
@ethomson
Copy link
Member

This is a good catch. Thanks, @tniessen!

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.

3 participants