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


crypto/ocsp/ocsp_prn.c:159:8: Call
157.   		cid = one->reqCert;
158.   		ocsp_certid_print(bp, cid, 8);
159.   		if (!X509V3_extensions_print(bp,
              ^
160.   					"Request Single Extensions",
161.   					one->singleRequestExtensions, flags, 8))

crypto/x509v3/v3_prn.c:165:1: Parameter `**exts->data`
  163.   }
  164.   
  165. > int X509V3_extensions_print(BIO *bp, char *title, STACK_OF(X509_EXTENSION) *exts, unsigned long flag, int indent)
  166.   {
  167.   	int i, j;

crypto/ocsp/ocsp_prn.c:172:4: Call
170.   		for (i=0; i<sk_X509_num(sig->certs); i++)
171.   			{
172.   			X509_print(bp, sk_X509_value(sig->certs,i));
          ^
173.   			PEM_write_bio_X509(bp,sk_X509_value(sig->certs,i));
174.   			}

crypto/asn1/t_x509.c:99:1: Parameter `*x->cert_info->validity->notAfter->data`
  97.   #endif
  98.   
  99. > int X509_print(BIO *bp, X509 *x)
  100.   {
  101.   	return X509_print_ex(bp, x, XN_FLAG_COMPAT, X509_FLAG_COMPAT);

crypto/asn1/t_x509.c:101:9: Call
  99.   int X509_print(BIO *bp, X509 *x)
  100.   {
  101.   	return X509_print_ex(bp, x, XN_FLAG_COMPAT, X509_FLAG_COMPAT);
                 ^
  102.   }
  103.   

crypto/asn1/t_x509.c:104:1: Parameter `*x->cert_info->validity->notAfter->data`
    102.   }
    103.   
    104. > int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags, unsigned long cflag)
    105.   	{
    106.   	long l;

crypto/asn1/t_x509.c:191:8: Call
    189.   		if (!ASN1_TIME_print(bp,X509_get_notBefore(x))) goto err;
    190.   		if (BIO_write(bp,"\n            Not After : ",25) <= 0) goto err;
    191.   		if (!ASN1_TIME_print(bp,X509_get_notAfter(x))) goto err;
                  ^
    192.   		if (BIO_write(bp,"\n",1) <= 0) goto err;
    193.   		}

crypto/asn1/t_x509.c:361:1: Parameter `*tm->data`
      359.   	}
      360.   
      361. > int ASN1_TIME_print(BIO *bp, ASN1_TIME *tm)
      362.   {
      363.   	if(tm->type == V_ASN1_UTCTIME) return ASN1_UTCTIME_print(bp, tm);

crypto/asn1/t_x509.c:365:12: Call
      363.   	if(tm->type == V_ASN1_UTCTIME) return ASN1_UTCTIME_print(bp, tm);
      364.   	if(tm->type == V_ASN1_GENERALIZEDTIME)
      365.   				return ASN1_GENERALIZEDTIME_print(bp, tm);
                        ^
      366.   	BIO_write(bp,"Bad time value",14);
      367.   	return(0);

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

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

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

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

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

crypto/asn1/t_x509.c:414:3: Array access: Offset: [-529, +oo] Size: 12 by call to `X509_print` 
        412.   
        413.   	if (BIO_printf(bp,"%s %2d %02d:%02d:%02d%.*s %d%s",
        414.   		mon[M-1],d,h,m,s,f_len,f,y,(gmt)?" GMT":"") <= 0)
                 ^
        415.   		return(0);
        416.   	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;
	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 (	(v[12] >= '0') && (v[12] <= '9') &&
		(v[13] >= '0') && (v[13] <= '9'))
		{
		s=  (v[12]-'0')*10+(v[13]-'0');
		if (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_REQUEST_print(BIO *bp, OCSP_REQUEST* o, unsigned long flags)\n        {\n\tint i;\n\tlong l;\n\tOCSP_CERTID* cid = NULL;\n\tOCSP_ONEREQ *one = NULL;\n\tOCSP_REQINFO *inf = o->tbsRequest;\n\tOCSP_SIGNATURE *sig = o->optionalSignature;\n\tif (BIO_write(bp,"OCSP Request Data:\\n",19) <= 0) goto err;\n\tl=ASN1_INTEGER_get(inf->version);\n\tif (BIO_printf(bp,"    Version: %lu (0x%lx)",l+1,l) <= 0) goto err;\n\tif (inf->requestorName != NULL)\n\t        {\n\t\tif (BIO_write(bp,"\\n    Requestor Name: ",21) <= 0)\n\t\t        goto err;\n\t\tGENERAL_NAME_print(bp, inf->requestorName);\n\t\t}\n\tif (BIO_write(bp,"\\n    Requestor List:\\n",21) <= 0) goto err;\n\tfor (i = 0; i < sk_OCSP_ONEREQ_num(inf->requestList); i++)\n\t        {\n\t\tone = sk_OCSP_ONEREQ_value(inf->requestList, i);\n\t\tcid = one->reqCert;\n\t\tocsp_certid_print(bp, cid, 8);\n\t\tif (!X509V3_extensions_print(bp,\n\t\t\t\t\t"Request Single Extensions",\n\t\t\t\t\tone->singleRequestExtensions, flags, 8))\n\t\t\t\t\t\t\tgoto err;\n\t\t}\n\tif (!X509V3_extensions_print(bp, "Request Extensions",\n\t\t\tinf->requestExtensions, flags, 4))\n\t\t\t\t\t\t\tgoto err;\n\tif (sig)\n\t        {\n\t\tX509_signature_print(bp, sig->signatureAlgorithm, sig->signature);\n\t\tfor (i=0; i<sk_X509_num(sig->certs); i++)\n\t\t\t{\n\t\t\tX509_print(bp, sk_X509_value(sig->certs,i));\n\t\t\tPEM_write_bio_X509(bp,sk_X509_value(sig->certs,i));\n\t\t\t}\n\t\t}\n\treturn 1;\nerr:\n\treturn 0;\n\t}', 'int X509V3_extensions_print(BIO *bp, char *title, STACK_OF(X509_EXTENSION) *exts, unsigned long flag, int indent)\n{\n\tint i, j;\n\tif(sk_X509_EXTENSION_num(exts) <= 0) return 1;\n\tif(title)\n\t\t{\n\t\tBIO_printf(bp,"%*s%s:\\n",indent, "", title);\n\t\tindent += 4;\n\t\t}\n\tfor (i=0; i<sk_X509_EXTENSION_num(exts); i++)\n\t\t{\n\t\tASN1_OBJECT *obj;\n\t\tX509_EXTENSION *ex;\n\t\tex=sk_X509_EXTENSION_value(exts, i);\n\t\tif (indent && BIO_printf(bp,"%*s",indent, "") <= 0) return 0;\n\t\tobj=X509_EXTENSION_get_object(ex);\n\t\ti2a_ASN1_OBJECT(bp,obj);\n\t\tj=X509_EXTENSION_get_critical(ex);\n\t\tif (BIO_printf(bp,": %s\\n",j?"critical":"") <= 0)\n\t\t\treturn 0;\n\t\tif(!X509V3_EXT_print(bp, ex, flag, indent + 4))\n\t\t\t{\n\t\t\tBIO_printf(bp, "%*s", indent + 4, "");\n\t\t\tM_ASN1_OCTET_STRING_print(bp,ex->value);\n\t\t\t}\n\t\tif (BIO_write(bp,"\\n",1) <= 0) return 0;\n\t\t}\n\treturn 1;\n}', 'int X509_print(BIO *bp, X509 *x)\n{\n\treturn X509_print_ex(bp, x, XN_FLAG_COMPAT, X509_FLAG_COMPAT);\n}', 'int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags, unsigned long cflag)\n\t{\n\tlong l;\n\tint ret=0,i;\n\tchar *m=NULL,mlch = \' \';\n\tint nmindent = 0;\n\tX509_CINF *ci;\n\tASN1_INTEGER *bs;\n\tEVP_PKEY *pkey=NULL;\n\tconst char *neg;\n\tASN1_STRING *str=NULL;\n\tif((nmflags & XN_FLAG_SEP_MASK) == XN_FLAG_SEP_MULTILINE) {\n\t\t\tmlch = \'\\n\';\n\t\t\tnmindent = 12;\n\t}\n\tif(nmflags == X509_FLAG_COMPAT)\n\t\tnmindent = 16;\n\tci=x->cert_info;\n\tif(!(cflag & X509_FLAG_NO_HEADER))\n\t\t{\n\t\tif (BIO_write(bp,"Certificate:\\n",13) <= 0) goto err;\n\t\tif (BIO_write(bp,"    Data:\\n",10) <= 0) goto err;\n\t\t}\n\tif(!(cflag & X509_FLAG_NO_VERSION))\n\t\t{\n\t\tl=X509_get_version(x);\n\t\tif (BIO_printf(bp,"%8sVersion: %lu (0x%lx)\\n","",l+1,l) <= 0) goto err;\n\t\t}\n\tif(!(cflag & X509_FLAG_NO_SERIAL))\n\t\t{\n\t\tif (BIO_write(bp,"        Serial Number:",22) <= 0) goto err;\n\t\tbs=X509_get_serialNumber(x);\n\t\tif (bs->length <= 4)\n\t\t\t{\n\t\t\tl=ASN1_INTEGER_get(bs);\n\t\t\tif (l < 0)\n\t\t\t\t{\n\t\t\t\tl= -l;\n\t\t\t\tneg="-";\n\t\t\t\t}\n\t\t\telse\n\t\t\t\tneg="";\n\t\t\tif (BIO_printf(bp," %s%lu (%s0x%lx)\\n",neg,l,neg,l) <= 0)\n\t\t\t\tgoto err;\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tneg=(bs->type == V_ASN1_NEG_INTEGER)?" (Negative)":"";\n\t\t\tif (BIO_printf(bp,"\\n%12s%s","",neg) <= 0) goto err;\n\t\t\tfor (i=0; i<bs->length; i++)\n\t\t\t\t{\n\t\t\t\tif (BIO_printf(bp,"%02x%c",bs->data[i],\n\t\t\t\t\t((i+1 == bs->length)?\'\\n\':\':\')) <= 0)\n\t\t\t\t\tgoto err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\tif(!(cflag & X509_FLAG_NO_SIGNAME))\n\t\t{\n\t\tif (BIO_printf(bp,"%8sSignature Algorithm: ","") <= 0)\n\t\t\tgoto err;\n\t\tif (i2a_ASN1_OBJECT(bp, ci->signature->algorithm) <= 0)\n\t\t\tgoto err;\n\t\tif (BIO_puts(bp, "\\n") <= 0)\n\t\t\tgoto err;\n\t\t}\n\tif(!(cflag & X509_FLAG_NO_ISSUER))\n\t\t{\n\t\tif (BIO_printf(bp,"        Issuer:%c",mlch) <= 0) goto err;\n\t\tif (X509_NAME_print_ex(bp,X509_get_issuer_name(x),nmindent, nmflags) < 0) goto err;\n\t\tif (BIO_write(bp,"\\n",1) <= 0) goto err;\n\t\t}\n\tif(!(cflag & X509_FLAG_NO_VALIDITY))\n\t\t{\n\t\tif (BIO_write(bp,"        Validity\\n",17) <= 0) goto err;\n\t\tif (BIO_write(bp,"            Not Before: ",24) <= 0) goto err;\n\t\tif (!ASN1_TIME_print(bp,X509_get_notBefore(x))) goto err;\n\t\tif (BIO_write(bp,"\\n            Not After : ",25) <= 0) goto err;\n\t\tif (!ASN1_TIME_print(bp,X509_get_notAfter(x))) goto err;\n\t\tif (BIO_write(bp,"\\n",1) <= 0) goto err;\n\t\t}\n\tif(!(cflag & X509_FLAG_NO_SUBJECT))\n\t\t{\n\t\tif (BIO_printf(bp,"        Subject:%c",mlch) <= 0) goto err;\n\t\tif (X509_NAME_print_ex(bp,X509_get_subject_name(x),nmindent, nmflags) < 0) goto err;\n\t\tif (BIO_write(bp,"\\n",1) <= 0) goto err;\n\t\t}\n\tif(!(cflag & X509_FLAG_NO_PUBKEY))\n\t\t{\n\t\tif (BIO_write(bp,"        Subject Public Key Info:\\n",33) <= 0)\n\t\t\tgoto err;\n\t\tif (BIO_printf(bp,"%12sPublic Key Algorithm: ","") <= 0)\n\t\t\tgoto err;\n\t\tif (i2a_ASN1_OBJECT(bp, ci->key->algor->algorithm) <= 0)\n\t\t\tgoto err;\n\t\tif (BIO_puts(bp, "\\n") <= 0)\n\t\t\tgoto err;\n\t\tpkey=X509_get_pubkey(x);\n\t\tif (pkey == NULL)\n\t\t\t{\n\t\t\tBIO_printf(bp,"%12sUnable to load Public Key\\n","");\n\t\t\tERR_print_errors(bp);\n\t\t\t}\n\t\telse\n#ifndef OPENSSL_NO_RSA\n\t\tif (pkey->type == EVP_PKEY_RSA)\n\t\t\t{\n\t\t\tBIO_printf(bp,"%12sRSA Public Key: (%d bit)\\n","",\n\t\t\tBN_num_bits(pkey->pkey.rsa->n));\n\t\t\tRSA_print(bp,pkey->pkey.rsa,16);\n\t\t\t}\n\t\telse\n#endif\n#ifndef OPENSSL_NO_DSA\n\t\tif (pkey->type == EVP_PKEY_DSA)\n\t\t\t{\n\t\t\tBIO_printf(bp,"%12sDSA Public Key:\\n","");\n\t\t\tDSA_print(bp,pkey->pkey.dsa,16);\n\t\t\t}\n\t\telse\n#endif\n#ifndef OPENSSL_NO_EC\n\t\tif (pkey->type == EVP_PKEY_EC)\n\t\t\t{\n\t\t\tBIO_printf(bp, "%12sEC Public Key:\\n","");\n\t\t\tEC_KEY_print(bp, pkey->pkey.ec, 16);\n\t\t\t}\n\t\telse\n#endif\n\t\t\tBIO_printf(bp,"%12sUnknown Public Key:\\n","");\n\t\tEVP_PKEY_free(pkey);\n\t\t}\n\tif (!(cflag & X509_FLAG_NO_EXTENSIONS))\n\t\tX509V3_extensions_print(bp, "X509v3 extensions",\n\t\t\t\t\tci->extensions, cflag, 8);\n\tif(!(cflag & X509_FLAG_NO_SIGDUMP))\n\t\t{\n\t\tif(X509_signature_print(bp, x->sig_alg, x->signature) <= 0) goto err;\n\t\t}\n\tif(!(cflag & X509_FLAG_NO_AUX))\n\t\t{\n\t\tif (!X509_CERT_AUX_print(bp, x->aux, 0)) goto err;\n\t\t}\n\tret=1;\nerr:\n\tif (str != NULL) ASN1_STRING_free(str);\n\tif (m != NULL) OPENSSL_free(m);\n\treturn(ret);\n\t}', 'int ASN1_TIME_print(BIO *bp, ASN1_TIME *tm)\n{\n\tif(tm->type == V_ASN1_UTCTIME) return ASN1_UTCTIME_print(bp, tm);\n\tif(tm->type == V_ASN1_GENERALIZEDTIME)\n\t\t\t\treturn ASN1_GENERALIZEDTIME_print(bp, tm);\n\tBIO_write(bp,"Bad time value",14);\n\treturn(0);\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\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 + (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\t{\n\t\ts=  (v[12]-\'0\')*10+(v[13]-\'0\');\n\t\tif (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}']