Skip to content

Commit

Permalink
libutee: remove redundant NULL check in TEE_BigIntComputeExtendedGcd()
Browse files Browse the repository at this point in the history
The gcd parameter passed to TEE_BigIntComputeExtendedGcd() must not
be NULL so skip the unnecessary NULL check.

This fixes coverity scan:
CID 1501842 (#1 of 1): Dereference after null check (FORWARD_NULL)

Reviewed-by: Jerome Forissier <[email protected]>
Signed-off-by: Jens Wiklander <[email protected]>
  • Loading branch information
jenswi-linaro authored and jforissier committed Feb 24, 2021
1 parent ab2e003 commit b6fa905
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/libutee/tee_api_arith_mpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -710,9 +710,7 @@ void TEE_BigIntComputeExtendedGcd(TEE_BigInt *gcd, TEE_BigInt *u,
get_mpi(&mpi_op2, op2);

if (!u && !v) {
if (gcd)
MPI_CHECK(mbedtls_mpi_gcd(&mpi_gcd_res, &mpi_op1,
pop2));
MPI_CHECK(mbedtls_mpi_gcd(&mpi_gcd_res, &mpi_op1, pop2));
} else {
mbedtls_mpi mpi_u;
mbedtls_mpi mpi_v;
Expand Down

0 comments on commit b6fa905

Please sign in to comment.