Skip to content

Commit

Permalink
index: don't crash on parts without a type
Browse files Browse the repository at this point in the history
  • Loading branch information
brong committed Jan 21, 2025
1 parent ec0c876 commit cefd7ff
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions imap/index.c
Original file line number Diff line number Diff line change
Expand Up @@ -6097,9 +6097,12 @@ EXPORTED int index_getsearchtext(message_t *msg, const strarray_t *partids,

if (!message_get_leaf_types(msg, &types) && types.count) {
for (i = 0 ; i < types.count ; i+= 2) {
if (!types.data[i]) continue;
buf_setcstr(&buf, types.data[i]);
buf_putc(&buf, '/');
buf_appendcstr(&buf, types.data[i+1]);
if (types.data[i+1]) {
buf_putc(&buf, '/');
buf_appendcstr(&buf, types.data[i+1]);
}
stuff_part(receiver, str.conv, SEARCH_PART_TYPE, &buf);
}
}
Expand Down

0 comments on commit cefd7ff

Please sign in to comment.