crypto/ocsp/ocsp_prn.c:231: error: BUFFER_OVERRUN_L3
  Offset: [-529, +oo] Size: 12 by call to `ASN1_GENERALIZEDTIME_print`.
Showing all 11 steps of the trace


crypto/ocsp/ocsp_prn.c:223:11: Call
221.   		{
222.   		case V_OCSP_RESPID_NAME:
223.   		        X509_NAME_print_ex(bp, rid->value.byName, 0, XN_FLAG_ONELINE);
                 ^
224.   		        break;
225.   		case V_OCSP_RESPID_KEY:

crypto/asn1/a_strex.c:492:1: Parameter `**nm->entries->data`
  490.   /* Wrappers round the main functions */
  491.   
  492. > int X509_NAME_print_ex(BIO *out, X509_NAME *nm, int indent, unsigned long flags)
  493.   {
  494.   	if(flags == XN_FLAG_COMPAT)

crypto/asn1/a_strex.c:496:9: Call
  494.   	if(flags == XN_FLAG_COMPAT)
  495.   		return X509_NAME_print(out, nm, indent);
  496.   	return do_name_ex(send_bio_chars, out, nm, indent, flags);
                 ^
  497.   }
  498.   

crypto/asn1/a_strex.c:375:1: Parameter `**n->entries->data`
    373.   
    374.   
    375. > static int do_name_ex(char_io *io_ch, void *arg, X509_NAME *n,
    376.   				int indent, unsigned long flags)
    377.   {

crypto/ocsp/ocsp_prn.c:231:7: Call
229.   
230.   	if (BIO_printf(bp,"\n    Produced At: ")<=0) goto err;
231.   	if (!ASN1_GENERALIZEDTIME_print(bp, rd->producedAt)) goto err;
             ^
232.   	if (BIO_printf(bp,"\n    Responses:\n") <= 0) goto err;
233.   	for (i = 0; i < sk_OCSP_SINGLERESP_num(rd->responses); i++)

crypto/asn1/t_x509.c:363:1: <Offset trace>
361.       };
362.   
363. > int ASN1_GENERALIZEDTIME_print(BIO *bp, ASN1_GENERALIZEDTIME *tm)
364.   	{
365.   	char *v;

crypto/asn1/t_x509.c:363:1: Parameter `*tm->data`
  361.       };
  362.   
  363. > int ASN1_GENERALIZEDTIME_print(BIO *bp, ASN1_GENERALIZEDTIME *tm)
  364.   	{
  365.   	char *v;

crypto/asn1/t_x509.c:378:2: Assignment
  376.   		if ((v[i] > '9') || (v[i] < '0')) goto err;
  377.   	y= (v[0]-'0')*1000+(v[1]-'0')*100 + (v[2]-'0')*10+(v[3]-'0');
  378.   	M= (v[4]-'0')*10+(v[5]-'0');
          ^
  379.   	if ((M > 12) || (M < 1)) goto err;
  380.   	d= (v[6]-'0')*10+(v[7]-'0');

crypto/asn1/t_x509.c:357:1: <Length trace>
355.   }
356.   
357. > static const char *mon[12]=
358.       {
359.       "Jan","Feb","Mar","Apr","May","Jun",

crypto/asn1/t_x509.c:357:1: Array declaration
  355.   }
  356.   
  357. > static const char *mon[12]=
  358.       {
  359.       "Jan","Feb","Mar","Apr","May","Jun",

crypto/asn1/t_x509.c:388:3: Array access: Offset: [-529, +oo] Size: 12 by call to `ASN1_GENERALIZEDTIME_print` 
  386.   
  387.   	if (BIO_printf(bp,"%s %2d %02d:%02d:%02d %d%s",
  388.   		mon[M-1],d,h,m,s,y,(gmt)?" GMT":"") <= 0)
           ^
  389.   		return(0);
  390.   	else

int ASN1_GENERALIZEDTIME_print(BIO *bp, ASN1_GENERALIZEDTIME *tm)
	{
	char *v;
	int gmt=0;
	int i;
	int y=0,M=0,d=0,h=0,m=0,s=0;
	i=tm->length;
	v=(char *)tm->data;
	if (i < 12) goto err;
	if (v[i-1] == 'Z') gmt=1;
	for (i=0; i<12; i++)
		if ((v[i] > '9') || (v[i] < '0')) goto err;
	y= (v[0]-'0')*1000+(v[1]-'0')*100 + (v[2]-'0')*10+(v[3]-'0');
	M= (v[4]-'0')*10+(v[5]-'0');
	if ((M > 12) || (M < 1)) goto err;
	d= (v[6]-'0')*10+(v[7]-'0');
	h= (v[8]-'0')*10+(v[9]-'0');
	m=  (v[10]-'0')*10+(v[11]-'0');
	if (	(v[12] >= '0') && (v[12] <= '9') &&
		(v[13] >= '0') && (v[13] <= '9'))
		s=  (v[12]-'0')*10+(v[13]-'0');
	if (BIO_printf(bp,"%s %2d %02d:%02d:%02d %d%s",
		mon[M-1],d,h,m,s,y,(gmt)?" GMT":"") <= 0)
		return(0);
	else
		return(1);
err:
	BIO_write(bp,"Bad time value",14);
	return(0);
	}
['int OCSP_RESPONSE_print(BIO *bp, OCSP_RESPONSE* o, unsigned long flags)\n        {\n\tint i;\n\tlong l;\n\tunsigned char *p;\n\tOCSP_CERTID *cid = NULL;\n\tOCSP_BASICRESP *br = NULL;\n\tOCSP_RESPID *rid = NULL;\n\tOCSP_RESPDATA  *rd = NULL;\n\tOCSP_CERTSTATUS *cst = NULL;\n\tOCSP_REVOKEDINFO *rev = NULL;\n\tOCSP_SINGLERESP *single = NULL;\n\tOCSP_RESPBYTES *rb = o->responseBytes;\n\tif (BIO_puts(bp,"OCSP Response Data:\\n") <= 0) goto err;\n\tl=ASN1_ENUMERATED_get(o->responseStatus);\n\tif (BIO_printf(bp,"    OCSP Response Status: %s (0x%x)\\n",\n\t\t       ocspResponseStatus2string(l), l) <= 0) goto err;\n\tif (rb == NULL) return 1;\n        if (BIO_puts(bp,"    Response Type: ") <= 0)\n\t        goto err;\n\tif(i2a_ASN1_OBJECT(bp, rb->responseType) <= 0)\n\t        goto err;\n\tif (OBJ_obj2nid(rb->responseType) != NID_id_pkix_OCSP_basic)\n\t        {\n\t\tBIO_puts(bp," (unknown response type)\\n");\n\t\treturn 1;\n\t\t}\n\tp = ASN1_STRING_data(rb->response);\n\ti = ASN1_STRING_length(rb->response);\n\tif (!(d2i_OCSP_BASICRESP(&br, &p, i))) goto err;\n\trd = br->tbsResponseData;\n\tl=ASN1_INTEGER_get(rd->version);\n\tif (BIO_printf(bp,"\\n    Version: %lu (0x%lx)\\n",\n\t\t       l+1,l) <= 0) goto err;\n\tif (BIO_puts(bp,"    Responder Id: ") <= 0) goto err;\n\trid =  rd->responderId;\n\tswitch (rid->type)\n\t\t{\n\t\tcase V_OCSP_RESPID_NAME:\n\t\t        X509_NAME_print_ex(bp, rid->value.byName, 0, XN_FLAG_ONELINE);\n\t\t        break;\n\t\tcase V_OCSP_RESPID_KEY:\n\t\t        i2a_ASN1_STRING(bp, rid->value.byKey, V_ASN1_OCTET_STRING);\n\t\t        break;\n\t\t}\n\tif (BIO_printf(bp,"\\n    Produced At: ")<=0) goto err;\n\tif (!ASN1_GENERALIZEDTIME_print(bp, rd->producedAt)) goto err;\n\tif (BIO_printf(bp,"\\n    Responses:\\n") <= 0) goto err;\n\tfor (i = 0; i < sk_OCSP_SINGLERESP_num(rd->responses); i++)\n\t        {\n\t\tif (! sk_OCSP_SINGLERESP_value(rd->responses, i)) continue;\n\t\tsingle = sk_OCSP_SINGLERESP_value(rd->responses, i);\n\t\tcid = single->certId;\n\t\tif(ocsp_certid_print(bp, cid, 4) <= 0) goto err;\n\t\tcst = single->certStatus;\n\t\tif (BIO_printf(bp,"\\n    Cert Status: %s",\n\t\t\t       ocspCertStatus2string(cst->type)) <= 0)\n\t\t        goto err;\n\t\tif (cst->type == V_OCSP_CERTSTATUS_REVOKED)\n\t\t        {\n\t\t        rev = cst->value.revoked;\n\t\t\tif (BIO_printf(bp, "\\n    Revocation Time: ") <= 0)\n\t\t\t        goto err;\n\t\t\tif (!ASN1_GENERALIZEDTIME_print(bp,\n\t\t\t\t\t\t\trev->revocationTime))\n\t\t\t\tgoto err;\n\t\t\tif (rev->revocationReason)\n\t\t\t        {\n\t\t\t\tl=ASN1_ENUMERATED_get(rev->revocationReason);\n\t\t\t\tif (BIO_printf(bp,\n\t\t\t\t\t "\\n    Revocation Reason: %s (0x%x)",\n\t\t\t\t\t       cRLReason2string(l), l) <= 0)\n\t\t\t\t        goto err;\n\t\t\t\t}\n\t\t\t}\n\t\tif (BIO_printf(bp,"\\n    This Update: ") <= 0) goto err;\n\t\tif (!ASN1_GENERALIZEDTIME_print(bp, single->thisUpdate))\n\t\t\tgoto err;\n\t\tif (single->nextUpdate)\n\t\t        {\n\t\t\tif (BIO_printf(bp,"\\n    Next Update: ") <= 0)goto err;\n\t\t\tif (!ASN1_GENERALIZEDTIME_print(bp,single->nextUpdate))\n\t\t\t\tgoto err;\n\t\t\t}\n\t\tif (!BIO_write(bp,"\\n",1)) goto err;\n\t\tif (!X509V3_extensions_print(bp,\n\t\t\t\t\t"Response Single Extensions",\n\t\t\t\t\tsingle->singleExtensions, flags, 8))\n\t\t\t\t\t\t\tgoto err;\n\t\t}\n\tif (!X509V3_extensions_print(bp, "Response Extensions",\n\t\t\t\t\trd->responseExtensions, flags, 4))\n\tif(X509_signature_print(bp, br->signatureAlgorithm, br->signature) <= 0)\n\t\t\t\t\t\t\tgoto err;\n\tfor (i=0; i<sk_X509_num(br->certs); i++)\n\t\t{\n\t\tX509_print(bp, sk_X509_value(br->certs,i));\n\t\tPEM_write_bio_X509(bp,sk_X509_value(br->certs,i));\n\t\t}\n\treturn 1;\nerr:\n\treturn 0;\n\t}', 'int X509_NAME_print_ex(BIO *out, X509_NAME *nm, int indent, unsigned long flags)\n{\n\tif(flags == XN_FLAG_COMPAT)\n\t\treturn X509_NAME_print(out, nm, indent);\n\treturn do_name_ex(send_bio_chars, out, nm, indent, flags);\n}', 'static int do_name_ex(char_io *io_ch, void *arg, X509_NAME *n,\n\t\t\t\tint indent, unsigned long flags)\n{\n\tint i, prev = -1, orflags, cnt;\n\tint fn_opt, fn_nid;\n\tASN1_OBJECT *fn;\n\tASN1_STRING *val;\n\tX509_NAME_ENTRY *ent;\n\tchar objtmp[80];\n\tconst char *objbuf;\n\tint outlen, len;\n\tchar *sep_dn, *sep_mv, *sep_eq;\n\tint sep_dn_len, sep_mv_len, sep_eq_len;\n\tif(indent < 0) indent = 0;\n\toutlen = indent;\n\tif(!do_indent(io_ch, arg, indent)) return -1;\n\tswitch (flags & XN_FLAG_SEP_MASK)\n\t{\n\t\tcase XN_FLAG_SEP_MULTILINE:\n\t\tsep_dn = "\\n";\n\t\tsep_dn_len = 1;\n\t\tsep_mv = " + ";\n\t\tsep_mv_len = 3;\n\t\tbreak;\n\t\tcase XN_FLAG_SEP_COMMA_PLUS:\n\t\tsep_dn = ",";\n\t\tsep_dn_len = 1;\n\t\tsep_mv = "+";\n\t\tsep_mv_len = 1;\n\t\tindent = 0;\n\t\tbreak;\n\t\tcase XN_FLAG_SEP_CPLUS_SPC:\n\t\tsep_dn = ", ";\n\t\tsep_dn_len = 2;\n\t\tsep_mv = " + ";\n\t\tsep_mv_len = 3;\n\t\tindent = 0;\n\t\tbreak;\n\t\tcase XN_FLAG_SEP_SPLUS_SPC:\n\t\tsep_dn = "; ";\n\t\tsep_dn_len = 2;\n\t\tsep_mv = " + ";\n\t\tsep_mv_len = 3;\n\t\tindent = 0;\n\t\tbreak;\n\t\tdefault:\n\t\treturn -1;\n\t}\n\tif(flags & XN_FLAG_SPC_EQ) {\n\t\tsep_eq = " = ";\n\t\tsep_eq_len = 3;\n\t} else {\n\t\tsep_eq = "=";\n\t\tsep_eq_len = 1;\n\t}\n\tfn_opt = flags & XN_FLAG_FN_MASK;\n\tcnt = X509_NAME_entry_count(n);\n\tfor(i = 0; i < cnt; i++) {\n\t\tif(flags & XN_FLAG_DN_REV)\n\t\t\t\tent = X509_NAME_get_entry(n, cnt - i - 1);\n\t\telse ent = X509_NAME_get_entry(n, i);\n\t\tif(prev != -1) {\n\t\t\tif(prev == ent->set) {\n\t\t\t\tif(!io_ch(arg, sep_mv, sep_mv_len)) return -1;\n\t\t\t\toutlen += sep_mv_len;\n\t\t\t} else {\n\t\t\t\tif(!io_ch(arg, sep_dn, sep_dn_len)) return -1;\n\t\t\t\toutlen += sep_dn_len;\n\t\t\t\tif(!do_indent(io_ch, arg, indent)) return -1;\n\t\t\t\toutlen += indent;\n\t\t\t}\n\t\t}\n\t\tprev = ent->set;\n\t\tfn = X509_NAME_ENTRY_get_object(ent);\n\t\tval = X509_NAME_ENTRY_get_data(ent);\n\t\tfn_nid = OBJ_obj2nid(fn);\n\t\tif(fn_opt != XN_FLAG_FN_NONE) {\n\t\t\tint objlen;\n\t\t\tif((fn_opt == XN_FLAG_FN_OID) || (fn_nid==NID_undef) ) {\n\t\t\t\tOBJ_obj2txt(objtmp, 80, fn, 1);\n\t\t\t\tobjbuf = objtmp;\n\t\t\t} else {\n\t\t\t\tif(fn_opt == XN_FLAG_FN_SN)\n\t\t\t\t\tobjbuf = OBJ_nid2sn(fn_nid);\n\t\t\t\telse if(fn_opt == XN_FLAG_FN_LN)\n\t\t\t\t\tobjbuf = OBJ_nid2ln(fn_nid);\n\t\t\t\telse objbuf = "";\n\t\t\t}\n\t\t\tobjlen = strlen(objbuf);\n\t\t\tif(!io_ch(arg, objbuf, objlen)) return -1;\n\t\t\tif(!io_ch(arg, sep_eq, sep_eq_len)) return -1;\n\t\t\toutlen += objlen + sep_eq_len;\n\t\t}\n\t\tif((fn_nid == NID_undef) && (flags & XN_FLAG_DUMP_UNKNOWN_FIELDS))\n\t\t\t\t\torflags = ASN1_STRFLGS_DUMP_ALL;\n\t\telse orflags = 0;\n\t\tlen = do_print_ex(io_ch, arg, flags | orflags, val);\n\t\tif(len < 0) return -1;\n\t\toutlen += len;\n\t}\n\treturn outlen;\n}', 'int ASN1_GENERALIZEDTIME_print(BIO *bp, ASN1_GENERALIZEDTIME *tm)\n\t{\n\tchar *v;\n\tint gmt=0;\n\tint i;\n\tint y=0,M=0,d=0,h=0,m=0,s=0;\n\ti=tm->length;\n\tv=(char *)tm->data;\n\tif (i < 12) goto err;\n\tif (v[i-1] == \'Z\') gmt=1;\n\tfor (i=0; i<12; i++)\n\t\tif ((v[i] > \'9\') || (v[i] < \'0\')) goto err;\n\ty= (v[0]-\'0\')*1000+(v[1]-\'0\')*100 + (v[2]-\'0\')*10+(v[3]-\'0\');\n\tM= (v[4]-\'0\')*10+(v[5]-\'0\');\n\tif ((M > 12) || (M < 1)) goto err;\n\td= (v[6]-\'0\')*10+(v[7]-\'0\');\n\th= (v[8]-\'0\')*10+(v[9]-\'0\');\n\tm=  (v[10]-\'0\')*10+(v[11]-\'0\');\n\tif (\t(v[12] >= \'0\') && (v[12] <= \'9\') &&\n\t\t(v[13] >= \'0\') && (v[13] <= \'9\'))\n\t\ts=  (v[12]-\'0\')*10+(v[13]-\'0\');\n\tif (BIO_printf(bp,"%s %2d %02d:%02d:%02d %d%s",\n\t\tmon[M-1],d,h,m,s,y,(gmt)?" GMT":"") <= 0)\n\t\treturn(0);\n\telse\n\t\treturn(1);\nerr:\n\tBIO_write(bp,"Bad time value",14);\n\treturn(0);\n\t}']