FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

#6028: Check if `threadstate->error_t.message` is not `git_buf__initbuf` before freeing. by arroz · Pull Request #6029 · libgit2/libgit2 · GitHub

#6028: Check if threadstate->error_t.message is not git_buf__initbuf before freeing. - #6029

Merged
ethomson merged 1 commit into
libgit2:mainfrom
arroz:fix_6028
Sep 3, 2021
Merged

ethomson merged 1 commit into
libgit2:mainfrom
arroz:fix_6028

Conversation

arroz commented Sep 3, 2021

Copy link
Copy Markdown
Contributor

This follows the same principle as buffer.c where the same check is done before freeing the buffer. It fixes the crash described in #6028.

…__initbuf` before freeing.

This follows the same principle as `buffer.c` where the same check is done before freeing the buffer. It fixes the crash described in libgit2#6028.
Comment thread src/threadstate.c
Comment on lines +39 to +40
if (threadstate->error_t.message != git_buf__initbuf)
git__free(threadstate->error_t.message);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM - just a quick whitespace fix:

Suggested change
if (threadstate->error_t.message != git_buf__initbuf)
git__free(threadstate->error_t.message);
if (threadstate->error_t.message != git_buf__initbuf)
git__free(threadstate->error_t.message);

ethomson commented Sep 3, 2021

Copy link
Copy Markdown
Member

Thanks for tracking this down!

ethomson merged commit a88fdda into libgit2:main Sep 3, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

2 participants


Back | FazBrowse Home | New Git URL