From 483917529f452d98cdb54bb097322259bbf1cdc7 Mon Sep 17 00:00:00 2001 From: Christoph Zurnieden Date: Mon, 20 Apr 2026 14:43:31 +0200 Subject: [PATCH] Input check added --- mp_from_sbin.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mp_from_sbin.c b/mp_from_sbin.c index 26eb0f120..2d32a1d8b 100644 --- a/mp_from_sbin.c +++ b/mp_from_sbin.c @@ -8,6 +8,9 @@ mp_err mp_from_sbin(mp_int *a, const uint8_t *buf, size_t size) { mp_err err; + if (size == 0) { + return MP_VAL; + } /* read magnitude */ if ((err = mp_from_ubin(a, buf + 1, size - 1u)) != MP_OKAY) { return err;