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

Fix IMAP SCAN on selected mailbox crasher #4552

Merged
merged 3 commits into from
Aug 2, 2023
Merged

Fix IMAP SCAN on selected mailbox crasher #4552

merged 3 commits into from
Aug 2, 2023

Conversation

ksmurchison
Copy link
Contributor

imapd.c: needs an open mailbox for index_scan(), imapd_index is released before every command is parsed, so we need to reopen the mailbox

@ksmurchison ksmurchison requested review from rsto and elliefm July 25, 2023 17:17
Copy link
Contributor

@elliefm elliefm left a comment

Choose a reason for hiding this comment

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

The fix looks fine on a code read, but can you please add a test to prove it (and to prevent us breaking it again in the future)? Thanks

Copy link
Member

@rsto rsto left a comment

Choose a reason for hiding this comment

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

Agree with @elliefm, code looks good but please add a test.

@ksmurchison
Copy link
Contributor Author

Actually, SCAN was broken worse than just the crasher. It always returned nothing due to a logic error in the ACL test. And then it returned EXISTS, RECENT, and FLAGS responses fro every mailbox that is scanned. All issues have been fixed and tested - SCAN with/without a previously SELECTed mailbox

@ksmurchison ksmurchison requested review from rsto and elliefm July 26, 2023 20:19
Copy link
Contributor

@elliefm elliefm left a comment

Choose a reason for hiding this comment

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

Looks good, thanks

@rsto
Copy link
Member

rsto commented Aug 2, 2023

I fixed a memory leak in the new code and pushed an update.

Signed-off-by: Robert Stepanek <[email protected]>
@rsto rsto merged commit ed02770 into master Aug 2, 2023
1 of 2 checks passed
@rsto rsto deleted the imap_scan_fix branch August 2, 2023 06:28
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