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


crypto/ocsp/ocsp_lib.c:578:2: Call
576.   		       l+1,l) <= 0) goto err;
577.   	if (BIO_printf(bp,"Basic Response Data Responder Id: ") <= 0) goto err;
578.   	i2a_OCSP_RESPID(bp, rd->responderId);
        ^
579.   	if (BIO_printf(bp,"\nBasic Response Data Produced At: ")<=0) goto err;
580.   	if (!ASN1_GENERALIZEDTIME_print(bp, rd->producedAt)) goto err;

crypto/ocsp/ocsp_res.c:277:1: Parameter `**a->value.byName->entries->data`
  275.   	}
  276.   
  277. > int i2a_OCSP_RESPID(BIO *bp, OCSP_RESPID* a)
  278.           {
  279.   	switch (a->tag)

crypto/ocsp/ocsp_lib.c:580:7: Call
578.   	i2a_OCSP_RESPID(bp, rd->responderId);
579.   	if (BIO_printf(bp,"\nBasic Response Data Produced At: ")<=0) goto err;
580.   	if (!ASN1_GENERALIZEDTIME_print(bp, rd->producedAt)) goto err;
             ^
581.   	if (BIO_printf(bp,"\nBasic Response Data Responses:\n") <= 0) goto err;
582.   	for (i = 0; i < sk_OCSP_SINGLERESP_num(rd->responses); i++)

crypto/asn1/t_x509.c:379:1: <Offset trace>
377.       };
378.   
379. > int ASN1_GENERALIZEDTIME_print(BIO *bp, ASN1_GENERALIZEDTIME *tm)
380.   	{
381.   	char *v;

crypto/asn1/t_x509.c:379:1: Parameter `*tm->data`
  377.       };
  378.   
  379. > int ASN1_GENERALIZEDTIME_print(BIO *bp, ASN1_GENERALIZEDTIME *tm)
  380.   	{
  381.   	char *v;

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

crypto/asn1/t_x509.c:373:1: <Length trace>
371.   }
372.   
373. > static const char *mon[12]=
374.       {
375.       "Jan","Feb","Mar","Apr","May","Jun",

crypto/asn1/t_x509.c:373:1: Array declaration
  371.   }
  372.   
  373. > static const char *mon[12]=
  374.       {
  375.       "Jan","Feb","Mar","Apr","May","Jun",

crypto/asn1/t_x509.c:404:3: Array access: Offset: [-529, +oo] Size: 12 by call to `ASN1_GENERALIZEDTIME_print` 
  402.   
  403.   	if (BIO_printf(bp,"%s %2d %02d:%02d:%02d %d%s",
  404.   		mon[M-1],d,h,m,s,y,(gmt)?" GMT":"") <= 0)
           ^
  405.   		return(0);
  406.   	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)\n        {\n\tint i, j, n;\n\tlong l;\n\tchar *s;\n\tunsigned char *p;\n\tOCSP_CERTID *cid = NULL;\n\tOCSP_BASICRESP *br = 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\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\ti=OBJ_obj2nid(rb->responseType);\n        if (BIO_printf(bp,"OCSP Response Bytes Response Type: %s",\n\t\t       (i == NID_undef)?"UNKNOWN":OBJ_nid2sn(i)) <= 0)\n\t        goto err;\n\tif (i != NID_id_pkix_OCSP_basic)\n\t        {\n\t\tBIO_printf(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,"\\nBasic Response Data Version: %lu (0x%lx)\\n",\n\t\t       l+1,l) <= 0) goto err;\n\tif (BIO_printf(bp,"Basic Response Data Responder Id: ") <= 0) goto err;\n\ti2a_OCSP_RESPID(bp, rd->responderId);\n\tif (BIO_printf(bp,"\\nBasic Response Data Produced At: ")<=0) goto err;\n\tif (!ASN1_GENERALIZEDTIME_print(bp, rd->producedAt)) goto err;\n\tif (BIO_printf(bp,"\\nBasic Response Data 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\tj=OBJ_obj2nid(cid->hashAlgorithm->algorithm);\n\t\tif (BIO_printf(bp,"    Cert Id:") <= 0) goto err;\n\t\tif (BIO_printf(bp,"\\n%8sHash Algorithm: %s","",\n\t\t\t       (j == NID_undef)?"UNKNOWN":OBJ_nid2ln(j)) <= 0)\n\t\t        goto err;\n\t\tif (BIO_write(bp,"\\n        Issuer Name Hash: ",27) <= 0)\n\t\t        goto err;\n\t\ti2a_ASN1_STRING(bp, cid->issuerNameHash, V_ASN1_OCTET_STRING);\n\t\tif (BIO_write(bp,"\\n        Issuer Key Hash: ",26) <= 0)\n\t\t        goto err;\n\t\ti2a_ASN1_STRING(bp, cid->issuerKeyHash, V_ASN1_OCTET_STRING);\n\t\tif (BIO_write(bp,"\\n        Serial Number: ",24) <= 0)\n\t\t        goto err;\n\t\tif (!i2a_ASN1_INTEGER(bp, cid->serialNumber))\n\t\t        goto err;\n\t\tcst = single->certStatus;\n\t\tif (BIO_printf(bp,"\\n    Cert Status: %s (0x%x)",\n\t\t\t       ocspCertStatus2string(cst->tag), cst->tag) <= 0)\n\t\t        goto err;\n\t\tif (cst->tag == V_OCSP_CERTSTATUS_REVOKED)\n\t\t        {\n\t\t        rev = cst->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 (!OCSP_extensions_print(bp, single->singleExtensions,\n\t\t\t\t\t   "Basic Response Single Extensions"))\n\t\t        goto err;\n\t\t}\n\tif (!OCSP_extensions_print(bp, rd->responseExtensions,\n\t\t\t\t   "Basic Response Extensions")) goto err;\n\ti=OBJ_obj2nid(br->signatureAlgorithm->algorithm);\n\tif (BIO_printf(bp,"Basic Response Signature Algorithm: %s",\n\t\t       (i == NID_undef)?"UNKNOWN":OBJ_nid2ln(i)) <= 0)\n\t        goto err;\n\tn=br->signature->length;\n\ts=(char *)br->signature->data;\n\tfor (i=0; i<n; i++)\n\t\t{\n\t\tif ((i%18) == 0)\n\t\tif (BIO_write(bp,"\\n        ",9) <= 0) goto err;\n\t\tif (BIO_printf(bp,"%02x%s",(unsigned char)s[i],\n\t\t\t((i+1) == n)?"":":") <= 0) goto err;\n\t\t}\n\tif (BIO_write(bp,"\\n",1) != 1) goto err;\n\tif (br->certs)\n\t        {\n\t\tfor (i=0; i<sk_X509_num(br->certs); i++)\n\t\t\tif (sk_X509_value(br->certs,i) != NULL) {\n\t\t\t\tX509_print(bp, sk_X509_value(br->certs,i));\n\t\t\t\tPEM_write_bio_X509(bp,sk_X509_value(br->certs,i));\n\t\t\t}\n\t\t}\n\treturn 1;\nerr:\n\treturn 0;\n\t}', 'int i2a_OCSP_RESPID(BIO *bp, OCSP_RESPID* a)\n        {\n\tswitch (a->tag)\n\t\t{\n\t\tcase V_OCSP_RESPID_NAME:\n\t\t        X509_NAME_print(bp, a->value.byName, 16);\n\t\t        break;\n\t\tcase V_OCSP_RESPID_KEY:\n\t\t        i2a_ASN1_STRING(bp, a->value.byKey, V_ASN1_OCTET_STRING);\n\t\t        break;\n\t\t}\n\treturn 1;\n\t}', '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}']