| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
The fix as-is does not suffice, unfortunately. Problem is that we may jump to the on_error label previous to initializing iterator->base.cb, where we call git_iterator_free(&iterator->base). But git_iterator_free will dereference iterator->base.cb->free then, leading to undefined behavior. So in addition to your improvement, we should also move up initialization of the callbacks. |
Sorry, something went wrong.
|
Ugh, sorry. You're right. I didn't pay close enough attention to where the callbacks are set. I moved the initialization of the base members above the initialization of the filesystem members. |
Sorry, something went wrong.
|
No worries, the error existed already before you touching the code. Thanks for the fix. I'll wait another day for comments and then merge tomorrow if none are incoming. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
git_iterator_free tries to free iter->root (and iter->current_path) via the filesystem_iterator_free callback after it has already been freed. I couldn't figure out what caused the on_error case to begin with or else I would have tried to make a test case.