Skip to content

Commit

Permalink
interp.c: protect against duplicate case values (zero)
Browse files Browse the repository at this point in the history
  • Loading branch information
ksmurchison authored and elliefm committed Aug 20, 2024
1 parent 8075008 commit 4ab196b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sieve/interp.c
Original file line number Diff line number Diff line change
Expand Up @@ -609,9 +609,11 @@ unsigned long long extension_isactive(sieve_interp_t *interp, const char *str)
(config_ext & IMAP_ENUM_SIEVE_EXTENSIONS_FILEINTO))) capa = 0;
break;

#ifdef ENABLE_REGEX
case SIEVE_CAPA_REGEX:
if (!(config_ext & IMAP_ENUM_SIEVE_EXTENSIONS_REGEX)) capa = 0;
break;
#endif

case SIEVE_CAPA_COPY:
if (!(config_ext & IMAP_ENUM_SIEVE_EXTENSIONS_COPY)) capa = 0;
Expand Down Expand Up @@ -668,7 +670,6 @@ unsigned long long extension_isactive(sieve_interp_t *interp, const char *str)
break;

case SIEVE_CAPA_ENOTIFY:
case SIEVE_CAPA_NOTIFY:
if (!(interp->notify &&
(config_ext & IMAP_ENUM_SIEVE_EXTENSIONS_NOTIFY))) capa = 0;
break;
Expand Down Expand Up @@ -749,11 +750,13 @@ unsigned long long extension_isactive(sieve_interp_t *interp, const char *str)
(config_ext & IMAP_ENUM_SIEVE_EXTENSIONS_VND_CYRUS_LOG))) capa = 0;
break;

#ifdef WITH_JMAP
case SIEVE_CAPA_JMAPQUERY:
if (!(interp->jmapquery &&
(config_ext & IMAP_ENUM_SIEVE_EXTENSIONS_VND_CYRUS_JMAPQUERY)))
capa = 0;
break;
#endif

case SIEVE_CAPA_SNOOZE:
if (!(interp->snooze &&
Expand Down

0 comments on commit 4ab196b

Please sign in to comment.