]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-index: Use SIZE_MAX with str_sanitize
authorAki Tuomi <aki.tuomi@open-xchange.com>
Tue, 1 Sep 2020 06:57:04 +0000 (09:57 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Thu, 22 Oct 2020 12:16:16 +0000 (12:16 +0000)
src/lib-index/mail-index-map.c
src/lib-index/mail-index.c

index ae0f4ee24b546d88b66f8388ae6c3741cf3a235f..a8faaa02e0b9a5b07650eabff1c6b218372c4cf9 100644 (file)
@@ -132,7 +132,7 @@ int mail_index_map_ext_get_next(struct mail_index_map *map,
 
        *name_r = t_strndup(CONST_PTR_OFFSET(map->hdr_base, name_offset),
                            ext_hdr->name_size);
-       if (strcmp(*name_r, str_sanitize(*name_r, -1)) != 0) {
+       if (strcmp(*name_r, str_sanitize(*name_r, SIZE_MAX)) != 0) {
                /* we allow only plain ASCII names, so this extension
                   is most likely broken */
                *name_r = "";
index 6b54979e07d896cb22fbf07f8c0272decab88b5f..0ef4bebd799e50a593760a9046d318f611c1a549 100644 (file)
@@ -254,7 +254,7 @@ uint32_t mail_index_ext_register(struct mail_index *index, const char *name,
        struct mail_index_registered_ext rext;
        uint32_t ext_id;
 
-       if (*name == '\0' || strcmp(name, str_sanitize(name, -1)) != 0)
+       if (*name == '\0' || strcmp(name, str_sanitize(name, SIZE_MAX)) != 0)
                i_panic("mail_index_ext_register(%s): Invalid name", name);
 
        if (default_record_size != 0 && default_record_align == 0) {