mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-24 01:43:33 +00:00
Cleanly reject bits == 0 when calling mbedtls_ecdsa_raw_to_der() and mbedtls_ecdsa_der_to_raw(). This can plausibly happen when bits is user-provided data that the calling application doesn't check. Before this patch, there was typically-benign undefined behavior, such as adding 0 to a null pointer or calling memcpy on a null pointer with a size of 0. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>