mirror of
https://0xacab.org/liberate/trees.git
synced 2024-11-24 03:00:56 +01:00
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 <dgoulet@riseup.net>
This commit is contained in:
parent
006059c8a4
commit
146993d0f4
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user