Skip to content

Commit ee4ba54

Browse files
committed
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.
1 parent d27a884 commit ee4ba54

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/ecdsa.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ static int ecdsa_sign_restartable( mbedtls_ecp_group *grp,
298298
*p_sign_tries = 0;
299299
do
300300
{
301-
if( *p_sign_tries++ > 10 )
301+
if( (*p_sign_tries)++ > 10 )
302302
{
303303
ret = MBEDTLS_ERR_ECP_RANDOM_FAILED;
304304
goto cleanup;
@@ -311,7 +311,7 @@ static int ecdsa_sign_restartable( mbedtls_ecp_group *grp,
311311
*p_key_tries = 0;
312312
do
313313
{
314-
if( *p_key_tries++ > 10 )
314+
if( (*p_key_tries)++ > 10 )
315315
{
316316
ret = MBEDTLS_ERR_ECP_RANDOM_FAILED;
317317
goto cleanup;

0 commit comments

Comments
 (0)