Commit a36c5eab authored by Matt Caswell's avatar Matt Caswell
Browse files

Sanity check an ASN1_object_size result



If it's negative don't try and malloc it.

Reviewed-by: default avatarTim Hudson <tjh@openssl.org>
parent b197257d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -373,6 +373,8 @@ ASN1_OBJECT *OBJ_txt2obj(const char *s, int no_name)
    }
    /* Work out total size */
    j = ASN1_object_size(0, i, V_ASN1_OBJECT);
    if (j < 0)
        return NULL;

    if ((buf = OPENSSL_malloc(j)) == NULL)
        return NULL;