crypto/ocsp/ocsp_prn.c:229: 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:210:13: Call
208.   
209.   	i = ASN1_STRING_length(rb->response);
210.   	if (!(br = OCSP_response_get1_basic(o))) goto err;
                   ^
211.   	rd = br->tbsResponseData;
212.   	l=ASN1_INTEGER_get(rd->version);

crypto/ocsp/ocsp_cl.c:196:1: Parameter `*resp->responseBytes->response->data`
  194.    
  195.   
  196. > OCSP_BASICRESP *OCSP_response_get1_basic(OCSP_RESPONSE *resp)
  197.   	{
  198.   	OCSP_RESPBYTES *rb;

crypto/ocsp/ocsp_prn.c:212:4: Call
210.   	if (!(br = OCSP_response_get1_basic(o))) goto err;
211.   	rd = br->tbsResponseData;
212.   	l=ASN1_INTEGER_get(rd->version);
          ^
213.   	if (BIO_printf(bp,"\n    Version: %lu (0x%lx)\n",
214.   		       l+1,l) <= 0) goto err;

crypto/asn1/a_int.c:374:1: Parameter `*a->data`
  372.   	}
  373.   
  374. > long ASN1_INTEGER_get(const ASN1_INTEGER *a)
  375.   	{
  376.   	int neg=0,i;

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

crypto/asn1/t_x509.c:404:1: <Offset trace>
402.       };
403.   
404. > int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm)
405.   	{
406.   	char *v;

crypto/asn1/t_x509.c:404:1: Parameter `*tm->data`
  402.       };
  403.   
  404. > int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm)
  405.   	{
  406.   	char *v;

crypto/asn1/t_x509.c:422:2: Assignment
  420.   	y= (v[0]-'0')*1000+(v[1]-'0')*100
  421.   		+ (v[2]-'0')*10+(v[3]-'0');
  422.   	M= (v[4]-'0')*10+(v[5]-'0');
          ^
  423.   	if ((M > 12) || (M < 1)) goto err;
  424.   	d= (v[6]-'0')*10+(v[7]-'0');

crypto/asn1/t_x509.c:398:1: <Length trace>
396.   }
397.   
398. > static const char *mon[12]=
399.       {
400.       "Jan","Feb","Mar","Apr","May","Jun",

crypto/asn1/t_x509.c:398:1: Array declaration
  396.   }
  397.   
  398. > static const char *mon[12]=
  399.       {
  400.       "Jan","Feb","Mar","Apr","May","Jun",

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

int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm)
	{
	char *v;
	int gmt=0;
	int i;
	int y=0,M=0,d=0,h=0,m=0,s=0;
	char *f = NULL;
	int f_len = 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 (tm->length >= 14 &&
	    (v[12] >= '0') && (v[12] <= '9') &&
	    (v[13] >= '0') && (v[13] <= '9'))
		{
		s=  (v[12]-'0')*10+(v[13]-'0');
		if (tm->length >= 15 && v[14] == '.')
			{
			int l = tm->length;
			f = &v[14];
			f_len = 1;
			while (14 + f_len < l && f[f_len] >= '0' && f[f_len] <= '9')
				++f_len;
			}
		}
	if (BIO_printf(bp,"%s %2d %02d:%02d:%02d%.*s %d%s",
		mon[M-1],d,h,m,s,f_len,f,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, ret = 0;\n\tlong l;\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%lx)\\n",\n\t\t       OCSP_response_status_str(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\ti = ASN1_STRING_length(rb->response);\n\tif (!(br = OCSP_response_get1_basic(o))) 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,"    Cert Status: %s",\n\t\t\t       OCSP_cert_status_str(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%lx)",\n\t\t\t\t\t       OCSP_crl_reason_str(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) <= 0) 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\tif (BIO_write(bp,"\\n",1) <= 0) goto err;\n\t\t}\n\tif (!X509V3_extensions_print(bp, "Response Extensions",\n\t\t\t\t\trd->responseExtensions, flags, 4))\n\t\t\t\t\t\t\tgoto err;\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\tret = 1;\nerr:\n\tOCSP_BASICRESP_free(br);\n\treturn ret;\n\t}', 'OCSP_BASICRESP *OCSP_response_get1_basic(OCSP_RESPONSE *resp)\n\t{\n\tOCSP_RESPBYTES *rb;\n\trb = resp->responseBytes;\n\tif (!rb)\n\t\t{\n\t\tOCSPerr(OCSP_F_OCSP_RESPONSE_GET1_BASIC, OCSP_R_NO_RESPONSE_DATA);\n\t\treturn NULL;\n\t\t}\n\tif (OBJ_obj2nid(rb->responseType) != NID_id_pkix_OCSP_basic)\n\t\t{\n\t\tOCSPerr(OCSP_F_OCSP_RESPONSE_GET1_BASIC, OCSP_R_NOT_BASIC_RESPONSE);\n\t\treturn NULL;\n\t\t}\n\treturn ASN1_item_unpack(rb->response, ASN1_ITEM_rptr(OCSP_BASICRESP));\n\t}', 'long ASN1_INTEGER_get(const ASN1_INTEGER *a)\n\t{\n\tint neg=0,i;\n\tlong r=0;\n\tif (a == NULL) return(0L);\n\ti=a->type;\n\tif (i == V_ASN1_NEG_INTEGER)\n\t\tneg=1;\n\telse if (i != V_ASN1_INTEGER)\n\t\treturn -1;\n\tif (a->length > (int)sizeof(long))\n\t\t{\n\t\treturn -1;\n\t\t}\n\tif (a->data == NULL)\n\t\treturn 0;\n\tfor (i=0; i<a->length; i++)\n\t\t{\n\t\tr<<=8;\n\t\tr|=(unsigned char)a->data[i];\n\t\t}\n\tif (neg) r= -r;\n\treturn(r);\n\t}', 'int ASN1_GENERALIZEDTIME_print(BIO *bp, const 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\tchar *f = NULL;\n\tint f_len = 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\n\t\t+ (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 (tm->length >= 14 &&\n\t    (v[12] >= \'0\') && (v[12] <= \'9\') &&\n\t    (v[13] >= \'0\') && (v[13] <= \'9\'))\n\t\t{\n\t\ts=  (v[12]-\'0\')*10+(v[13]-\'0\');\n\t\tif (tm->length >= 15 && v[14] == \'.\')\n\t\t\t{\n\t\t\tint l = tm->length;\n\t\t\tf = &v[14];\n\t\t\tf_len = 1;\n\t\t\twhile (14 + f_len < l && f[f_len] >= \'0\' && f[f_len] <= \'9\')\n\t\t\t\t++f_len;\n\t\t\t}\n\t\t}\n\tif (BIO_printf(bp,"%s %2d %02d:%02d:%02d%.*s %d%s",\n\t\tmon[M-1],d,h,m,s,f_len,f,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}']