From 146993d0f4cabe3e9faab01ae09e0e9c83e1ab4c Mon Sep 17 00:00:00 2001 From: David Goulet Date: Fri, 17 Mar 2017 12:35:25 -0400 Subject: [PATCH] Fix an overflow validation The transition from assert() to if() used the wrong comparaison making the plugin to not work. Fixes #10 Signed-off-by: David Goulet --- src/trees-ostream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/trees-ostream.c b/src/trees-ostream.c index c2b3a66..1b25a91 100644 --- a/src/trees-ostream.c +++ b/src/trees-ostream.c @@ -87,7 +87,7 @@ trees_ostream_send_chunk(struct trees_ostream *sstream, unsigned char ciphertext[ciphertext_len]; /* Extra protection here against overflow. */ - if (chunk_size < (SSIZE_MAX - crypto_box_SEALBYTES)) { + if (chunk_size >= (SSIZE_MAX - crypto_box_SEALBYTES)) { sstream->ostream.ostream.stream_errno = EIO; goto err; }