File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -4270,7 +4270,8 @@ void run_eckey_edge_case_test(void) {
42704270
42714271void test_xonly_pubkey (void ) {
42724272 unsigned char sk [32 ] = { 0 };
4273- unsigned char garbage [32 ];
4273+ unsigned char ones32 [32 ];
4274+ unsigned char zeros64 [64 ] = { 0 };
42744275 secp256k1_pubkey xy_pk ;
42754276 secp256k1_pubkey xy_pk_tmp ;
42764277 secp256k1_xonly_pubkey xonly_pk ;
@@ -4310,8 +4311,9 @@ void test_xonly_pubkey(void) {
43104311 CHECK (memcmp (& xonly_pk , & xonly_pk_tmp , sizeof (xonly_pk )) == 0 );
43114312
43124313 /* Can't parse a byte string that's not a valid X coordinate */
4313- memset (garbage , 0 , sizeof (garbage ));
4314- CHECK (secp256k1_xonly_pubkey_parse (ctx , & xonly_pk_tmp , garbage ) == 0 );
4314+ memset (ones32 , 0xFF , sizeof (ones32 ));
4315+ CHECK (secp256k1_xonly_pubkey_parse (ctx , & xonly_pk_tmp , ones32 ) == 0 );
4316+ CHECK (memcmp (& xonly_pk_tmp , zeros64 , sizeof (xonly_pk_tmp )) == 0 );
43154317}
43164318
43174319void test_xonly_pubkey_api (void ) {
You can’t perform that action at this time.
0 commit comments