Skip to content

Commit 39f3de8

Browse files
authored
Fix NULL ptr dereference on EC_POINT *point
Use non-usual params of pkcs11 module will trigger a null ptr deref bug. Fix it for openssl#25493
1 parent daead12 commit 39f3de8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

crypto/ec/ec_oct.c

+4
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ size_t EC_POINT_point2oct(const EC_GROUP *group, const EC_POINT *point,
7474
point_conversion_form_t form, unsigned char *buf,
7575
size_t len, BN_CTX *ctx)
7676
{
77+
if ( point == NULL){
78+
ERR_raise(ERR_LIB_EC, ERR_R_PASSED_NULL_PARAMETER);
79+
return 0;
80+
}
7781
if (group->meth->point2oct == 0
7882
&& !(group->meth->flags & EC_FLAGS_DEFAULT_OCT)) {
7983
ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);

0 commit comments

Comments
 (0)