]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: base64 - Fix base64_get_full_encoded_size() for size 0.
authorStephan Bosch <stephan.bosch@open-xchange.com>
Tue, 3 Sep 2019 10:22:16 +0000 (12:22 +0200)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Tue, 10 Sep 2019 07:02:36 +0000 (10:02 +0300)
src/lib/base64.c

index 7fe51a80985013f09faf749be36929e02871c248..26e87cde1db9ac6c587c31c31e5a766fc0906e82 100644 (file)
@@ -16,6 +16,9 @@ off_t base64_get_full_encoded_size(struct base64_encoder *enc, off_t src_size)
        off_t out_size;
        off_t newlines;
 
+       if (src_size == 0)
+               return 0;
+
        /* calculate size of encoded data */
        out_size = MAX_BASE64_ENCODED_SIZE(src_size);
        if (no_padding) {