From f438566f533de4b635c7a9c19875d2423e31eb7d Mon Sep 17 00:00:00 2001 From: PobreGato <315121269+pobregat0@users.noreply.github.com> Date: Tue, 6 Oct 2026 22:38:56 -0400 Subject: [PATCH] check BIGNUM for null in bn2buf --- libi2pd/Crypto.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libi2pd/Crypto.cpp b/libi2pd/Crypto.cpp index 376aec89..ccb96468 100644 --- a/libi2pd/Crypto.cpp +++ b/libi2pd/Crypto.cpp @@ -130,6 +130,7 @@ namespace crypto bool bn2buf (const BIGNUM * bn, uint8_t * buf, size_t len) { + if (!bn) return false; // BN_num_bytes dereferences its argument int offset = (int)len - (int)BN_num_bytes (bn); if (offset < 0) return false; BN_bn2bin (bn, buf + offset);