From 6ba5ff1b7b1547a59f750fbc06b89737b7456117 Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Thu, 8 Jan 2026 12:09:50 +0100 Subject: [PATCH] CVE-2026-0966 misc: Avoid heap buffer underflow in ssh_get_hexa MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakub Jelen Reviewed-by: Pavol Žáčik (cherry picked from commit 417a095e6749a1f3635e02332061edad3c6a3401) --- src/misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/misc.c b/src/misc.c index 774211fb..08c690b2 100644 --- a/src/misc.c +++ b/src/misc.c @@ -459,7 +459,7 @@ char *ssh_get_hexa(const unsigned char *what, size_t len) size_t i; size_t hlen = len * 3; - if (len > (UINT_MAX - 1) / 3) { + if (what == NULL || len < 1 || len > (UINT_MAX - 1) / 3) { return NULL; }