Check the result of blst_p2_uncompress (#297)

This commit is contained in:
Justin Traglia 2023-05-05 06:31:34 -05:00 committed by GitHub
parent ecb5499077
commit 5703f6f353
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -1786,7 +1786,13 @@ C_KZG_RET load_trusted_setup(
/* Convert all g2 bytes to g2 points */
for (i = 0; i < n2; i++) {
blst_p2_uncompress(&g2_affine, &g2_bytes[BYTES_PER_G2 * i]);
BLST_ERROR err = blst_p2_uncompress(
&g2_affine, &g2_bytes[BYTES_PER_G2 * i]
);
if (err != BLST_SUCCESS) {
ret = C_KZG_BADARGS;
goto out_error;
}
blst_p2_from_affine(&out->g2_values[i], &g2_affine);
}