Fix incrementing pointer instead of value

This was introduced by a hasty search-and-replace that didn't account for C's
operator precedence when changing those variables to pointer types.
This commit is contained in:
Manuel Pégourié-Gonnard 2020-01-24 12:11:56 +01:00 committed by Manuel Pégourié-Gonnard
parent 39e2c0eeb6
commit 42b8194b53
2 changed files with 12 additions and 2 deletions

View file

@ -297,7 +297,7 @@ static int ecdsa_sign_restartable( mbedtls_ecp_group *grp,
*p_sign_tries = 0;
do
{
if( *p_sign_tries++ > 10 )
if( (*p_sign_tries)++ > 10 )
{
ret = MBEDTLS_ERR_ECP_RANDOM_FAILED;
goto cleanup;
@ -310,7 +310,7 @@ static int ecdsa_sign_restartable( mbedtls_ecp_group *grp,
*p_key_tries = 0;
do
{
if( *p_key_tries++ > 10 )
if( (*p_key_tries)++ > 10 )
{
ret = MBEDTLS_ERR_ECP_RANDOM_FAILED;
goto cleanup;