From edb198038774232f44037209fd79b1d03c7191bd Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Sat, 15 Mar 2025 13:44:02 -0400 Subject: [PATCH] ssb: Address a -fanalyze issue. #114 --- src/ssb.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ssb.c b/src/ssb.c index da47e6bc..cdd5f63a 100644 --- a/src/ssb.c +++ b/src/ssb.c @@ -579,6 +579,11 @@ static void _tf_ssb_connection_box_stream_send(tf_ssb_connection_t* connection, { size_t send_size = size - offset > k_send_max ? k_send_max : size - offset; uint8_t* message_enc = tf_malloc(send_size + 34); + if (!message_enc) + { + tf_ssb_connection_close(connection, "out of memory"); + return; + } uint8_t nonce1[crypto_secretbox_NONCEBYTES]; memcpy(nonce1, connection->send_nonce, sizeof(nonce1));