We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c880fcf commit d4cf93cCopy full SHA for d4cf93c
wolfssl/wolfcrypt/sp_int.h
@@ -695,9 +695,11 @@ typedef struct sp_ecc_ctx {
695
#define sp_clamp(a) \
696
do { \
697
int ii; \
698
- for (ii = (int)(a)->used - 1; ii >= 0 && (a)->dp[ii] == 0; ii--) { \
+ if ((a)->used > 0) { \
699
+ for (ii = (int)(a)->used - 1; ii >= 0 && (a)->dp[ii] == 0; ii--) { \
700
+ } \
701
+ (a)->used = (unsigned int)ii + 1; \
702
} \
- (a)->used = (unsigned int)ii + 1; \
703
} while (0)
704
705
/* Check the compiled and linked math implementation are the same.
0 commit comments