Fix typo in i2d_ASN1_ENUMERATED
[openssl.git] / crypto / asn1 / a_enum.c
index afd8e9a..1428d1d 100644 (file)
@@ -79,7 +79,7 @@ int i2d_ASN1_ENUMERATED(ASN1_ENUMERATED *a, unsigned char **pp)
        len = i2c_ASN1_INTEGER(a, NULL);        
        ret=ASN1_object_size(0,len,V_ASN1_ENUMERATED);
        if(pp) {
-               ASN1_put_object(pp,0,ret,V_ASN1_ENUMERATED,V_ASN1_UNIVERSAL);
+               ASN1_put_object(pp,0,len,V_ASN1_ENUMERATED,V_ASN1_UNIVERSAL);
                i2c_ASN1_INTEGER(a, pp);        
        }
        return ret;