Increase tls_writer buffer by at least 4 bytes
authorMartin Willi <martin@revosec.ch>
Wed, 19 Jan 2011 13:41:59 +0000 (14:41 +0100)
committerMartin Willi <martin@revosec.ch>
Wed, 19 Jan 2011 13:41:59 +0000 (14:41 +0100)
src/libtls/tls_writer.c

index 235dc2c..e87c2ef 100644 (file)
@@ -226,7 +226,7 @@ tls_writer_t *tls_writer_create(u_int32_t bufsize)
                        .get_buf = _get_buf,
                        .destroy = _destroy,
                },
-               .increase = bufsize ?: 32,
+               .increase = bufsize ? max(bufsize, 4) : 32,
        );
        if (bufsize)
        {