]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-settings: Escape comma in section name.
authorSergey Kitov <sergey.kitov@open-xchange.com>
Thu, 24 Aug 2017 07:01:02 +0000 (10:01 +0300)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Tue, 12 Sep 2017 08:48:21 +0000 (11:48 +0300)
Comma is valid symbol in encoded non-ascii section names, so it
shouldn't be used as splitting symbol in section name.

src/lib-settings/settings-parser.c

index 7d13aa92ca19ec70b6871563569a792bf16af7dd..5471c578ca009918207dc360c00a82f1b1932f84 100644 (file)
@@ -2124,7 +2124,7 @@ int settings_parser_apply_changes(struct setting_parser_context *dest,
 const char *settings_section_escape(const char *name)
 {
 #define CHAR_NEED_ESCAPE(c) \
-       ((c) == '=' || (c) == SETTINGS_SEPARATOR || (c) == '\\' || (c) == ' ')
+       ((c) == '=' || (c) == SETTINGS_SEPARATOR || (c) == '\\' || (c) == ' ' || (c) == ',')
        string_t *str;
        unsigned int i;
 
@@ -2151,6 +2151,9 @@ const char *settings_section_escape(const char *name)
                case ' ':
                        str_append(str, "\\_");
                        break;
+               case ',':
+                       str_append(str, "\\+");
+                       break;
                default:
                        str_append_c(str, name[i]);
                        break;