]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-smtp: smtp-command - Use size_t for command line limits.
authorStephan Bosch <stephan.bosch@open-xchange.com>
Fri, 29 Oct 2021 21:44:01 +0000 (23:44 +0200)
committerStephan Bosch <stephan.bosch@open-xchange.com>
Wed, 3 Nov 2021 21:52:55 +0000 (22:52 +0100)
src/lib-smtp/smtp-command-parser.c
src/lib-smtp/smtp-command.h

index b2e44c512f113b388052ee7c0bdce05c5a076f25..575420a9a26dc7b549a223d995dc20685e77f33c 100644 (file)
@@ -31,7 +31,7 @@ struct smtp_command_parser_state_data {
        char *cmd_name;
        char *cmd_params;
 
-       uoff_t poff;
+       size_t poff;
 };
 
 struct smtp_command_parser {
@@ -165,7 +165,7 @@ static int smtp_command_parse_identifier(struct smtp_command_parser *parser)
 static int smtp_command_parse_parameters(struct smtp_command_parser *parser)
 {
        const unsigned char *p, *mp;
-       uoff_t max_size = (parser->auth_response ?
+       size_t max_size = (parser->auth_response ?
                           parser->limits.max_auth_size :
                           parser->limits.max_parameters_size);
        int nch = 1;
@@ -195,7 +195,7 @@ static int smtp_command_parse_parameters(struct smtp_command_parser *parser)
                        break;
                p += nch;
        }
-       if (max_size > 0 && (uoff_t)(p - parser->cur) > max_size) {
+       if (max_size > 0 && (size_t)(p - parser->cur) > max_size) {
                smtp_command_parser_error(
                        parser, SMTP_COMMAND_PARSE_ERROR_LINE_TOO_LONG,
                        "%s line is too long",
index 38605f194d28b3c2992d4e2d7798f64de8d2784e..94f225169fb956504fd72b3837ac48a5f0c136e0 100644 (file)
@@ -7,9 +7,9 @@
 
 struct smtp_command_limits {
        /* Maximum size of command parameters, starting after first space */
-       uoff_t max_parameters_size;
+       size_t max_parameters_size;
        /* Maximum size of authentication response */
-       uoff_t max_auth_size;
+       size_t max_auth_size;
        /* Absolute maximum size of command data, beyond which the parser yields
           a fatal error; i.e. closing the connection in the server. This should
           be higher than a normal message size limit, which would return a