bppp: check for overflow in generator allocation

This commit is contained in:
DarkWindman
2026-08-10 14:35:05 +03:00
parent a2b001cc20
commit 1de3864ff9
2 changed files with 7 additions and 0 deletions

View File

@@ -28,6 +28,8 @@ static void test_bppp_generators_api(void) {
CHECK(gens != NULL);
gens_orig = gens; /* Preserve for round-trip test */
CHECK(secp256k1_bppp_generators_create(CTX, SIZE_MAX / sizeof(secp256k1_ge) + 1) == NULL);
/* Serialize */
CHECK_ILLEGAL(CTX, secp256k1_bppp_generators_serialize(CTX, NULL, gens_ser, &len));
CHECK_ILLEGAL(CTX, secp256k1_bppp_generators_serialize(CTX, gens, NULL, &len));