Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

audit callbacks from mboxlist_findall() and friends for handling of data->mbname #2472

Closed
elliefm opened this issue Aug 9, 2018 · 1 comment
Labels
3.0 affects 3.0 3.1 affects 3.1 dev releases help wanted would like input from non-regular contributors

Comments

@elliefm
Copy link
Contributor

elliefm commented Aug 9, 2018

The mboxlist_findall() and related APIs will call the callback under a number of different situations:

  • a mailbox exactly matches the pattern(s)
  • a mailbox partially matches the pattern(s) due to being a child of a matching mailbox
  • a tombstone record matches the pattern(s)
  • other cases?

Depending on exactly how the pattern was matched, the callback may be called with its struct findall_data *data argument in various states:

  • data = NULL
  • data->mbname = NULL
  • data->mbentry = NULL

We keep getting issues where sections of code are naively not expecting partial matches, and then crashing because they depend on something being in the data struct which isn't.

So perhaps instead of fixing these piecemeal as they come up, we should actually audit all the callers of the mboxlist_findall() APIs to ensure their callback functions deal with partial matches sanely (in most cases, probably just by explicitly ignoring them, rather than crashing!).

@elliefm elliefm added help wanted would like input from non-regular contributors 3.0 affects 3.0 3.1 affects 3.1 dev releases labels Aug 9, 2018
@elliefm
Copy link
Contributor Author

elliefm commented Sep 16, 2019

This was taken care of by 6ecbeda

@elliefm elliefm closed this as completed Sep 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.0 affects 3.0 3.1 affects 3.1 dev releases help wanted would like input from non-regular contributors
Projects
None yet
Development

No branches or pull requests

1 participant