This fixes a simple copy and paste induced memory leak for the ecdsa init.
The tests are mostly just improving coverage and aren't interesting.
This fixes a simple copy and paste induced memory leak for the ecdsa init.
The tests are mostly just improving coverage and aren't interesting.
This fixes a simple copy and paste induced memory leak for the ecdsa init.
The tests are mostly just improving coverage and aren't interesting.
1163 | @@ -1119,6 +1164,15 @@ int main(int argc, char **argv) { 1164 | /* initialize */ 1165 | secp256k1_start(SECP256K1_START_SIGN | SECP256K1_START_VERIFY); 1166 | 1167 | + /* initializing a second time shouldn't cause any arm or memory leaks. */
s/arm/harm/
1208 | @@ -1155,5 +1209,14 @@ int main(int argc, char **argv) { 1209 | 1210 | /* shutdown */ 1211 | secp256k1_stop(); 1212 | + 1213 | + /* shutting down twice shouldn't caue any double frees. */
s/caue/cause/
1071 | + CHECK(secp256k1_ecdsa_recover_compact(msg32, 32, sigc64, pubkeyb, &pubkeyblen, 1, 0) == 1); 1072 | + CHECK(secp256k1_ecdsa_verify(msg32, 32, sigcder, sizeof(sigcder), pubkeyb, pubkeyblen) == 1); 1073 | + sigcder[4] = 0; 1074 | + sigc64[31] = 0; 1075 | + CHECK(secp256k1_ecdsa_recover_compact(msg32, 32, sigc64, pubkeyb, &pubkeyblen, 1, 0) == 0); 1076 | + CHECK(secp256k1_ecdsa_verify(msg32, 32, sigcder, sizeof(sigcder), pubkeyb, pubkeyblen) == 0);
The contents of pubkeyb isn't well-defined if recover_compact returns false.
Updated.
ACK