Skip to content

Commit

Permalink
Fix NULL ptr dereference on EC_POINT *point
Browse files Browse the repository at this point in the history
Use non-usual params of pkcs11 module will trigger a null ptr deref bug. Fix it for openssl#25493
  • Loading branch information
citypw committed Sep 19, 2024
1 parent daead12 commit ae78e9b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crypto/ec/ec_oct.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ size_t EC_POINT_point2oct(const EC_GROUP *group, const EC_POINT *point,
point_conversion_form_t form, unsigned char *buf,
size_t len, BN_CTX *ctx)
{
if (point == NULL) {
ERR_raise(ERR_LIB_EC, ERR_R_PASSED_NULL_PARAMETER);
return 0;
}
if (group->meth->point2oct == 0
&& !(group->meth->flags & EC_FLAGS_DEFAULT_OCT)) {
ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
Expand Down

0 comments on commit ae78e9b

Please sign in to comment.