Skip to content

Commit f9a04ae

Browse files
committed
Merge #302: extrakeys: fix pubkey_sort_cmp test
83d0fa2 extrakeys: fix pubkey_sort_cmp test (Jonas Nick) Pull request description: Instead of providing CTX directly, pass a cmp_data object containing CTX. Otherwise, memory sanitizer fails with "use-of-uninitialized-value". ACKs for top commit: real-or-random: utACK 83d0fa2 apoelstra: ACK 83d0fa2; successfully ran local tests Tree-SHA512: eb36c9f90632a3fb472653686ffb5c7a9c29849e05ab1084106a49c23e60ca1c90022ee1accd99ab5bfaa4fd5b3f4670cea8d5a2c415f00c05d645c793b6bedd
2 parents 6152622 + 83d0fa2 commit f9a04ae

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/modules/extrakeys/tests_impl.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,9 @@ static void test_sort(void) {
605605
}
606606
secp256k1_pubkey_sort(CTX, pk_ptr, 5);
607607
for (j = 1; j < 5; j++) {
608-
CHECK(secp256k1_pubkey_sort_cmp(&pk_ptr[j - 1], &pk_ptr[j], CTX) <= 0);
608+
secp256k1_pubkey_sort_cmp_data cmp_data;
609+
cmp_data.ctx = CTX;
610+
CHECK(secp256k1_pubkey_sort_cmp(&pk_ptr[j - 1], &pk_ptr[j], &cmp_data) <= 0);
609611
}
610612
}
611613
}

0 commit comments

Comments
 (0)