[PATCH 13/22] crypto: ecc: fix clang-analyzer warning about NULL dereference
Ahmad Fatoum
a.fatoum at pengutronix.de
Thu Mar 13 00:34:36 PDT 2025
clang-analyzer believes that point->x can dereference a NULL pointer.
I suspect that's not possible, because of the arguments the function is
called with, but let's play it safe and assert that point is non-NULL
before dereferencing.
Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
crypto/ecc.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/crypto/ecc.c b/crypto/ecc.c
index a0ab962262ca..d91948bddbde 100644
--- a/crypto/ecc.c
+++ b/crypto/ecc.c
@@ -1434,6 +1434,8 @@ void ecc_point_mult_shamir(const struct ecc_point *result,
idx |= (!!vli_test_bit(u2, i)) << 1;
point = points[idx];
+ BUG_ON(!point);
+
vli_set(rx, point->x, ndigits);
vli_set(ry, point->y, ndigits);
vli_clear(z + 1, ndigits - 1);
--
2.39.5
More information about the barebox
mailing list