crypto/x509/by_file.c:123: error: INTEGER_OVERFLOW_L2
  ([0, +oo] - 1):unsigned64 by call to `X509_load_crl_file`.
Showing all 12 steps of the trace


crypto/x509/by_file.c:122:7: Call
120.   		else
121.   			{
122.   			ok=X509_load_cert_file(ctx,argp,(int)argl);
             ^
123.   			ok2=X509_load_crl_file(ctx,argp,(int)argl);
124.   			}

crypto/x509/by_file.c:130:1: Parameter `ctx->store_ctx->certs->num_items`
  128.   	}
  129.   
  130. > int X509_load_cert_file(X509_LOOKUP *ctx, const char *file, int type)
  131.   	{
  132.   	int ret=0;

crypto/x509/by_file.c:123:8: Call
121.   			{
122.   			ok=X509_load_cert_file(ctx,argp,(int)argl);
123.   			ok2=X509_load_crl_file(ctx,argp,(int)argl);
              ^
124.   			}
125.   		break;

crypto/x509/by_file.c:197:1: Parameter `ctx->store_ctx->certs->num_items`
  195.   	}
  196.   
  197. > int X509_load_crl_file(X509_LOOKUP *ctx, const char *file, int type)
  198.   	{
  199.   	int ret=0;

crypto/x509/by_file.c:249:5: Call
  247.   			goto err;
  248.   			}
  249.   		i=X509_STORE_add_crl(ctx->store_ctx,x);
             ^
  250.   		if (!i) goto err;
  251.   		ret=i;

crypto/x509/x509_vfy.c:562:1: Parameter `ctx->certs->num_items`
    560.   	}
    561.   
    562. > int X509_STORE_add_crl(X509_STORE *ctx, X509_CRL *x)
    563.   	{
    564.   	X509_OBJECT *obj,*r;

crypto/x509/x509_vfy.c:581:19: Call
    579.   	X509_OBJECT_up_ref_count(obj);
    580.   
    581.   	r=(X509_OBJECT *)lh_insert(ctx->certs,(char *)obj);
                             ^
    582.   	if (r != NULL)
    583.   		{ /* oops, put it back */

crypto/lhash/lhash.c:182:1: Parameter `lh->num_items`
      180.   	}
      181.   
      182. > char *lh_insert(LHASH *lh, char *data)
      183.   	{
      184.   	unsigned long hash;

crypto/x509/x509_vfy.c:584:3: Call
    582.   	if (r != NULL)
    583.   		{ /* oops, put it back */
    584.   		lh_delete(ctx->certs,(char *)obj);
             ^
    585.   		X509_OBJECT_free_contents(obj);
    586.   		Free(obj);

crypto/lhash/lhash.c:220:1: <LHS trace>
218.   	}
219.   
220. > char *lh_delete(LHASH *lh, char *data)
221.   	{
222.   	unsigned long hash;

crypto/lhash/lhash.c:220:1: Parameter `lh->num_items`
      218.   	}
      219.   
      220. > char *lh_delete(LHASH *lh, char *data)
      221.   	{
      222.   	unsigned long hash;

crypto/lhash/lhash.c:243:2: Binary operation: ([0, +oo] - 1):unsigned64 by call to `X509_load_crl_file` 
      241.   		}
      242.   
      243.   	lh->num_items--;
              ^
      244.   	if ((lh->num_nodes > MIN_NODES) &&
      245.   		(lh->down_load >= (lh->num_items*LH_LOAD_MULT/lh->num_nodes)))

char *lh_delete(LHASH *lh, char *data)
	{
	unsigned long hash;
	LHASH_NODE *nn,**rn;
	char *ret;
	lh->error=0;
	rn=getrn(lh,data,&hash);
	if (*rn == NULL)
		{
		lh->num_no_delete++;
		return(NULL);
		}
	else
		{
		nn= *rn;
		*rn=nn->next;
		ret=nn->data;
		Free((char *)nn);
		lh->num_delete++;
		}
	lh->num_items--;
	if ((lh->num_nodes > MIN_NODES) &&
		(lh->down_load >= (lh->num_items*LH_LOAD_MULT/lh->num_nodes)))
		contract(lh);
	return(ret);
	}
['static int by_file_ctrl(X509_LOOKUP *ctx, int cmd, const char *argp, long argl,\n\t     char **ret)\n\t{\n\tint ok=0,ok2=0;\n\tchar *file;\n\tswitch (cmd)\n\t\t{\n\tcase X509_L_FILE_LOAD:\n\t\tif (argl == X509_FILETYPE_DEFAULT)\n\t\t\t{\n\t\t\tok=X509_load_cert_file(ctx,X509_get_default_cert_file(),\n\t\t\t\tX509_FILETYPE_PEM);\n\t\t\tok2=X509_load_crl_file(ctx,X509_get_default_cert_file(),\n\t\t\t\tX509_FILETYPE_PEM);\n\t\t\tif (!ok || !ok2)\n\t\t\t\t{\n\t\t\t\tX509err(X509_F_BY_FILE_CTRL,X509_R_LOADING_DEFAULTS);\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\n\t\t\t\tfile=(char *)Getenv(X509_get_default_cert_file_env());\n\t\t\t\tok=X509_load_cert_file(ctx,file,\n\t\t\t\t\tX509_FILETYPE_PEM);\n\t\t\t\tok2=X509_load_crl_file(ctx,file,\n\t\t\t\t\tX509_FILETYPE_PEM);\n\t\t\t\t}\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tok=X509_load_cert_file(ctx,argp,(int)argl);\n\t\t\tok2=X509_load_crl_file(ctx,argp,(int)argl);\n\t\t\t}\n\t\tbreak;\n\t\t}\n\treturn((ok && ok2)?ok:0);\n\t}', 'int X509_load_cert_file(X509_LOOKUP *ctx, const char *file, int type)\n\t{\n\tint ret=0;\n\tBIO *in=NULL;\n\tint i,count=0;\n\tX509 *x=NULL;\n\tif (file == NULL) return(1);\n\tin=BIO_new(BIO_s_file_internal());\n\tif ((in == NULL) || (BIO_read_filename(in,file) <= 0))\n\t\t{\n\t\tX509err(X509_F_X509_LOAD_CERT_FILE,ERR_R_SYS_LIB);\n\t\tgoto err;\n\t\t}\n\tif (type == X509_FILETYPE_PEM)\n\t\t{\n\t\tfor (;;)\n\t\t\t{\n\t\t\tx=PEM_read_bio_X509_AUX(in,NULL,NULL,NULL);\n\t\t\tif (x == NULL)\n\t\t\t\t{\n\t\t\t\tif ((ERR_GET_REASON(ERR_peek_error()) ==\n\t\t\t\t\tPEM_R_NO_START_LINE) && (count > 0))\n\t\t\t\t\t{\n\t\t\t\t\tERR_clear_error();\n\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\tX509err(X509_F_X509_LOAD_CERT_FILE,\n\t\t\t\t\t\tERR_R_PEM_LIB);\n\t\t\t\t\tgoto err;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\ti=X509_STORE_add_cert(ctx->store_ctx,x);\n\t\t\tif (!i) goto err;\n\t\t\tcount++;\n\t\t\tX509_free(x);\n\t\t\tx=NULL;\n\t\t\t}\n\t\tret=count;\n\t\t}\n\telse if (type == X509_FILETYPE_ASN1)\n\t\t{\n\t\tx=d2i_X509_bio(in,NULL);\n\t\tif (x == NULL)\n\t\t\t{\n\t\t\tX509err(X509_F_X509_LOAD_CERT_FILE,ERR_R_ASN1_LIB);\n\t\t\tgoto err;\n\t\t\t}\n\t\ti=X509_STORE_add_cert(ctx->store_ctx,x);\n\t\tif (!i) goto err;\n\t\tret=i;\n\t\t}\n\telse\n\t\t{\n\t\tX509err(X509_F_X509_LOAD_CERT_FILE,X509_R_BAD_X509_FILETYPE);\n\t\tgoto err;\n\t\t}\nerr:\n\tif (x != NULL) X509_free(x);\n\tif (in != NULL) BIO_free(in);\n\treturn(ret);\n\t}', 'int X509_load_crl_file(X509_LOOKUP *ctx, const char *file, int type)\n\t{\n\tint ret=0;\n\tBIO *in=NULL;\n\tint i,count=0;\n\tX509_CRL *x=NULL;\n\tif (file == NULL) return(1);\n\tin=BIO_new(BIO_s_file_internal());\n\tif ((in == NULL) || (BIO_read_filename(in,file) <= 0))\n\t\t{\n\t\tX509err(X509_F_X509_LOAD_CRL_FILE,ERR_R_SYS_LIB);\n\t\tgoto err;\n\t\t}\n\tif (type == X509_FILETYPE_PEM)\n\t\t{\n\t\tfor (;;)\n\t\t\t{\n\t\t\tx=PEM_read_bio_X509_CRL(in,NULL,NULL,NULL);\n\t\t\tif (x == NULL)\n\t\t\t\t{\n\t\t\t\tif ((ERR_GET_REASON(ERR_peek_error()) ==\n\t\t\t\t\tPEM_R_NO_START_LINE) && (count > 0))\n\t\t\t\t\t{\n\t\t\t\t\tERR_clear_error();\n\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\tX509err(X509_F_X509_LOAD_CRL_FILE,\n\t\t\t\t\t\tERR_R_PEM_LIB);\n\t\t\t\t\tgoto err;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\ti=X509_STORE_add_crl(ctx->store_ctx,x);\n\t\t\tif (!i) goto err;\n\t\t\tcount++;\n\t\t\tX509_CRL_free(x);\n\t\t\tx=NULL;\n\t\t\t}\n\t\tret=count;\n\t\t}\n\telse if (type == X509_FILETYPE_ASN1)\n\t\t{\n\t\tx=d2i_X509_CRL_bio(in,NULL);\n\t\tif (x == NULL)\n\t\t\t{\n\t\t\tX509err(X509_F_X509_LOAD_CRL_FILE,ERR_R_ASN1_LIB);\n\t\t\tgoto err;\n\t\t\t}\n\t\ti=X509_STORE_add_crl(ctx->store_ctx,x);\n\t\tif (!i) goto err;\n\t\tret=i;\n\t\t}\n\telse\n\t\t{\n\t\tX509err(X509_F_X509_LOAD_CRL_FILE,X509_R_BAD_X509_FILETYPE);\n\t\tgoto err;\n\t\t}\nerr:\n\tif (x != NULL) X509_CRL_free(x);\n\tif (in != NULL) BIO_free(in);\n\treturn(ret);\n\t}', 'int X509_STORE_add_crl(X509_STORE *ctx, X509_CRL *x)\n\t{\n\tX509_OBJECT *obj,*r;\n\tint ret=1;\n\tif (x == NULL) return(0);\n\tobj=(X509_OBJECT *)Malloc(sizeof(X509_OBJECT));\n\tif (obj == NULL)\n\t\t{\n\t\tX509err(X509_F_X509_STORE_ADD_CRL,ERR_R_MALLOC_FAILURE);\n\t\treturn(0);\n\t\t}\n\tobj->type=X509_LU_CRL;\n\tobj->data.crl=x;\n\tCRYPTO_w_lock(CRYPTO_LOCK_X509_STORE);\n\tX509_OBJECT_up_ref_count(obj);\n\tr=(X509_OBJECT *)lh_insert(ctx->certs,(char *)obj);\n\tif (r != NULL)\n\t\t{\n\t\tlh_delete(ctx->certs,(char *)obj);\n\t\tX509_OBJECT_free_contents(obj);\n\t\tFree(obj);\n\t\tlh_insert(ctx->certs,(char *)r);\n\t\tX509err(X509_F_X509_STORE_ADD_CRL,X509_R_CERT_ALREADY_IN_HASH_TABLE);\n\t\tret=0;\n\t\t}\n\tCRYPTO_w_unlock(CRYPTO_LOCK_X509_STORE);\n\treturn(ret);\n\t}', 'char *lh_insert(LHASH *lh, char *data)\n\t{\n\tunsigned long hash;\n\tLHASH_NODE *nn,**rn;\n\tchar *ret;\n\tlh->error=0;\n\tif (lh->up_load <= (lh->num_items*LH_LOAD_MULT/lh->num_nodes))\n\t\texpand(lh);\n\trn=getrn(lh,data,&hash);\n\tif (*rn == NULL)\n\t\t{\n\t\tif ((nn=(LHASH_NODE *)Malloc(sizeof(LHASH_NODE))) == NULL)\n\t\t\t{\n\t\t\tlh->error++;\n\t\t\treturn(NULL);\n\t\t\t}\n\t\tnn->data=data;\n\t\tnn->next=NULL;\n#ifndef NO_HASH_COMP\n\t\tnn->hash=hash;\n#endif\n\t\t*rn=nn;\n\t\tret=NULL;\n\t\tlh->num_insert++;\n\t\tlh->num_items++;\n\t\t}\n\telse\n\t\t{\n\t\tret= (*rn)->data;\n\t\t(*rn)->data=data;\n\t\tlh->num_replace++;\n\t\t}\n\treturn(ret);\n\t}', 'char *lh_delete(LHASH *lh, char *data)\n\t{\n\tunsigned long hash;\n\tLHASH_NODE *nn,**rn;\n\tchar *ret;\n\tlh->error=0;\n\trn=getrn(lh,data,&hash);\n\tif (*rn == NULL)\n\t\t{\n\t\tlh->num_no_delete++;\n\t\treturn(NULL);\n\t\t}\n\telse\n\t\t{\n\t\tnn= *rn;\n\t\t*rn=nn->next;\n\t\tret=nn->data;\n\t\tFree((char *)nn);\n\t\tlh->num_delete++;\n\t\t}\n\tlh->num_items--;\n\tif ((lh->num_nodes > MIN_NODES) &&\n\t\t(lh->down_load >= (lh->num_items*LH_LOAD_MULT/lh->num_nodes)))\n\t\tcontract(lh);\n\treturn(ret);\n\t}']