Parcourir la source

Check ASN1_OBJECT_new result

CLA: trivial

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23270)
Drokov Pavel il y a 4 mois
Parent
commit
6b92a966e0
1 fichiers modifiés avec 4 ajouts et 0 suppressions
  1. 4 0
      crypto/objects/obj_dat.c

+ 4 - 0
crypto/objects/obj_dat.c

@@ -790,6 +790,10 @@ int OBJ_create(const char *oid, const char *sn, const char *ln)
     } else {
         /* Create a no-OID ASN1_OBJECT */
         tmpoid = ASN1_OBJECT_new();
+        if (tmpoid == NULL) {
+            ERR_raise(ERR_LIB_OBJ, ERR_R_ASN1_LIB);
+            return 0;
+        }
     }
 
     if (!ossl_obj_write_lock(1)) {