]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: Fix using SETMETADATA NIL to unset value
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 3 May 2021 10:15:17 +0000 (13:15 +0300)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 4 May 2021 11:34:12 +0000 (14:34 +0300)
Broken by 923362d27d9b2428e301614673cb0efba3bf928f

src/imap/cmd-setmetadata.c

index a0ae56e0271e70bb951649b1f90f05d34c2a82d9..c21d1e2ae261522dcc3455b562eae8b372167d7d 100644 (file)
@@ -181,7 +181,9 @@ cmd_setmetadata_entry(struct imap_setmetadata_context *ctx,
                   Dovecot has traditionally supported it this is kept for
                   backwards compatibility just in case some client is
                   using it. */
-               if (!imap_arg_get_atom(entry_value, &value.value))
+               if (entry_value->type == IMAP_ARG_NIL)
+                       ;
+               else if (!imap_arg_get_atom(entry_value, &value.value))
                        value.value = imap_arg_as_nstring(entry_value);
                ret = imap_metadata_set(ctx->trans, entry_name, &value);
                if (ret < 0) {