Skip to content

Commit

Permalink
mailbox_get_xconvemodseq() is never called with NULL for *modseqp
Browse files Browse the repository at this point in the history
The way the function was written implied that the parameter modseqp could be NULL.
If it were NULL, then “*modseqp = status.threadmodseq;” would cause NULL-dereference.

In practice the function is never called with NULL as last parameter.
  • Loading branch information
dilyanpalauzov committed Aug 26, 2023
1 parent 6c852ba commit 1755d89
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions imap/mailbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -4387,9 +4387,6 @@ EXPORTED int mailbox_get_xconvmodseq(struct mailbox *mailbox, modseq_t *modseqp)
conv_status_t status = CONV_STATUS_INIT;
int r;

if (modseqp)
*modseqp = 0;

struct conversations_state *cstate = mailbox_get_cstate(mailbox);
if (!cstate) return 0;

Expand Down
2 changes: 1 addition & 1 deletion imap/mailbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ extern int mailbox_cid_rename(struct mailbox *mailbox,
conversation_id_t from_cid,
conversation_id_t to_cid);
extern int mailbox_add_conversations(struct mailbox *mailbox, int silent);
extern int mailbox_get_xconvmodseq(struct mailbox *mailbox, modseq_t *);
__attribute__((nonnull)) int mailbox_get_xconvmodseq(struct mailbox *mailbox, modseq_t *);
extern int mailbox_update_xconvmodseq(struct mailbox *mailbox, modseq_t, int force);
#define mailbox_has_conversations(m) mailbox_has_conversations_full(m, 0)
extern int mailbox_has_conversations_full(struct mailbox *mailbox, int allow_deleted);
Expand Down

0 comments on commit 1755d89

Please sign in to comment.