Fix memory leak on bad inputs.
[oweals/openssl.git] / crypto / asn1 / tasn_prn.c
index a0c71ea992c52f983ad189902c9880ef98fd8350..b9c96a6dbe1d523386ce6c345867e17a60c6d9c6 100644 (file)
@@ -1,5 +1,5 @@
 /* tasn_prn.c */
-/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL
+/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
  * project 2000.
  */
 /* ====================================================================
@@ -134,7 +134,9 @@ static int asn1_item_print_nm(BIO *out, void *fld, int indent, const ASN1_ITEM *
 int ASN1_template_print(BIO *out, void *fld, int indent, const ASN1_TEMPLATE *tt)
 {
        int i, flags;
-       //if(!fld) return 0;
+#if 0
+       if(!fld) return 0; 
+#endif
        flags = tt->flags;
        if(flags & ASN1_TFLG_SK_MASK) {
                char *tname;
@@ -184,7 +186,7 @@ if(*bool == -1) printf("BOOL MISSING\n");
                        char objbuf[80], *ln;
                        ln = OBJ_nid2ln(OBJ_obj2nid(fld));
                        if(!ln) ln = "";
-                       OBJ_obj2txt(objbuf, 80, fld, 1);
+                       OBJ_obj2txt(objbuf, sizeof objbuf, fld, 1);
                        BIO_printf(out, "%*s%s:%s (%s)", indent, "", "OBJECT", ln, objbuf);
                } else {
                        BIO_printf(out, "%*s%s:", indent, "", name);