Skip to content
Snippets Groups Projects
Unverified Commit 146993d0 authored by David Goulet's avatar David Goulet
Browse files

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: default avatarDavid Goulet <dgoulet@riseup.net>
parent 006059c8
No related branches found
No related tags found
No related merge requests found
...@@ -87,7 +87,7 @@ trees_ostream_send_chunk(struct trees_ostream *sstream, ...@@ -87,7 +87,7 @@ trees_ostream_send_chunk(struct trees_ostream *sstream,
unsigned char ciphertext[ciphertext_len]; unsigned char ciphertext[ciphertext_len];
/* Extra protection here against overflow. */ /* 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; sstream->ostream.ostream.stream_errno = EIO;
goto err; goto err;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment