]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-imap: imap_arg_get/as_nstring() - fail if input is an atom
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 25 Mar 2020 13:52:02 +0000 (15:52 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Fri, 22 Jan 2021 07:18:07 +0000 (07:18 +0000)
Atoms were wrongly allowed in these places.

These have been used in very few places, so this change should be pretty
safe to do. The only affected places are:

 * SETMETADATA - Backwards compatibility preserved by earlier commit
 * ID - It's not expected that any clients use atoms here
 * imapc - Server replies are parsed more strictly now

src/lib-imap/imap-arg.c
src/lib-imap/imap-bodystructure.c

index 3011b5fd00665dc73f6a8fb42ca4cd2195c4d764..0b947ce81421cd1a910bf656db6cf916d5558689 100644 (file)
@@ -47,7 +47,7 @@ bool imap_arg_get_nstring(const struct imap_arg *arg, const char **str_r)
                *str_r = NULL;
                return TRUE;
        }
-       return imap_arg_get_astring(arg, str_r);
+       return imap_arg_get_string(arg, str_r);
 }
 
 bool imap_arg_get_literal_size(const struct imap_arg *arg, uoff_t *size_r)
index 8b0bc92b8a92486ece2122d11ee357adf9496034..705447f1c48c5a0d57433053e2f69ed82559a018 100644 (file)
@@ -726,9 +726,6 @@ static bool str_append_nstring(string_t *str, const struct imap_arg *arg)
        case IMAP_ARG_NIL:
                str_append(str, "NIL");
                break;
-       case IMAP_ARG_ATOM:
-               str_append(str, cstr);
-               break;
        case IMAP_ARG_STRING:
                str_append_c(str, '"');
                /* NOTE: we're parsing with no-unescape flag,