From: Timo Sirainen Date: Sat, 3 Dec 2022 12:10:20 +0000 (+0200) Subject: imap: Add IMAP_NOTIFY_EVENT_COUNT and verify its name array size X-Git-Tag: 2.4.0~3290 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0dcd36ca59e24db1e8fd6ae50729465e26df41de;p=thirdparty%2Fdovecot%2Fcore.git imap: Add IMAP_NOTIFY_EVENT_COUNT and verify its name array size --- diff --git a/src/imap/cmd-notify.c b/src/imap/cmd-notify.c index 25d613deae..3e680bf4d0 100644 --- a/src/imap/cmd-notify.c +++ b/src/imap/cmd-notify.c @@ -17,6 +17,7 @@ static const char *imap_notify_event_names[] = { "MailboxName", "SubscriptionChange", "MailboxMetadataChange", "ServerMetadataChange" }; +static_assert_array_size(imap_notify_event_names, IMAP_NOTIFY_EVENT_COUNT); static int cmd_notify_parse_event(const struct imap_arg *arg, diff --git a/src/imap/imap-notify.h b/src/imap/imap-notify.h index 936d622047..c5fa4ae1ac 100644 --- a/src/imap/imap-notify.h +++ b/src/imap/imap-notify.h @@ -15,7 +15,9 @@ enum imap_notify_event { IMAP_NOTIFY_EVENT_MAILBOX_NAME = 0x10, IMAP_NOTIFY_EVENT_SUBSCRIPTION_CHANGE = 0x20, IMAP_NOTIFY_EVENT_MAILBOX_METADATA_CHANGE = 0x40, - IMAP_NOTIFY_EVENT_SERVER_METADATA_CHANGE = 0x80 + IMAP_NOTIFY_EVENT_SERVER_METADATA_CHANGE = 0x80, + + IMAP_NOTIFY_EVENT_COUNT = 8 }; #define UNSUPPORTED_EVENTS \ (IMAP_NOTIFY_EVENT_ANNOTATION_CHANGE | \