]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-index: Fix implicit integer truncation found by ubsan
authorSiavash Tavakoli <siavash.tavakoli@open-xchange.com>
Tue, 2 Feb 2021 12:43:50 +0000 (12:43 +0000)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Thu, 11 Feb 2021 10:42:15 +0000 (10:42 +0000)
src/lib-index/mail-index-transaction-view.c

index dc320c304b14bdb2070e1c24495eea45703e574b..240c7fedaee722a4b79ea7c218d1afc1c7c5f91e 100644 (file)
@@ -121,7 +121,7 @@ tview_apply_flag_updates(struct mail_index_view_transaction *tview,
 
        trec = PTR_OFFSET(tview->recs, (seq-1) * tview->record_size);
        memcpy(trec, rec, map->hdr.record_size);
-       trec->flags |= updates[idx].add_flags;
+       trec->flags |= updates[idx].add_flags & 0xff;
        trec->flags &= ENUM_NEGATE(updates[idx].remove_flags);
        return trec;
 }