Skip to content

Commit

Permalink
mod_webmail: Fix NULL dereference.
Browse files Browse the repository at this point in the history
fields can be NULL, so we need to verify it's non-NULL.
  • Loading branch information
InterLinked1 committed Dec 30, 2024
1 parent f8688ff commit b0597ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/mod_webmail.c
Original file line number Diff line number Diff line change
Expand Up @@ -2527,7 +2527,7 @@ static int fetch_mime_recurse(json_t *root, json_t *attachments, struct mailmime
* If its content-type is multipart, it's not an attachment.
* If its content-type is text, then you have to look at its content-disposition, which may be either inline or attachment.
* If it has another content-type, then it is an attachment." */
if (!is_multipart) { /* Multipart can't be an attachment */
if (!is_multipart && fields) { /* Multipart can't be an attachment */
for (cur = clist_begin(fields->fld_list); cur; cur = clist_next(cur)) {
clistiter *cur2;
const char *name = NULL;
Expand Down

0 comments on commit b0597ee

Please sign in to comment.