Skip to content

Commit

Permalink
Fix potential null pointer deferenced (#363)
Browse files Browse the repository at this point in the history
* Fix potential null pointer deferenced

clist_content is a MACRO and return NULL:
#define     clist_content(iter)            (iter ? (iter)->data : NULL)

* FIx invalid test against NULL.
  • Loading branch information
raniervf authored Apr 30, 2020
1 parent ae072d8 commit 68bde8b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/driver/implementation/imap/imapdriver_tools.c
Original file line number Diff line number Diff line change
Expand Up @@ -1716,7 +1716,7 @@ static int imap_mailbox_list_to_group(clist * imap_mb_list, clistiter ** iter,
imap_mailbox_listiter = * iter;

imap_addr = clist_content(imap_mailbox_listiter);
if (imap_addr->ad_mailbox_name == NULL) {
if (imap_addr == NULL || imap_addr->ad_mailbox_name == NULL) {
res = MAIL_ERROR_INVAL;
goto err;
}
Expand Down

0 comments on commit 68bde8b

Please sign in to comment.