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


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

crypto/x509/by_file.c:165:6: Call
163.   					}
164.   				}
165.   			i=X509_STORE_add_cert(ctx->store_ctx,x);
            ^
166.   			if (!i) goto err;
167.   			count++;

crypto/x509/x509_vfy.c:632:1: Parameter `ctx->certs->num_items`
  630.   	}
  631.   
  632. > int X509_STORE_add_cert(X509_STORE *ctx, X509 *x)
  633.   	{
  634.   	X509_OBJECT *obj,*r;

crypto/x509/x509_vfy.c:651:19: Call
  649.   	X509_OBJECT_up_ref_count(obj);
  650.   
  651.   	r=(X509_OBJECT *)lh_insert(ctx->certs,obj);
                           ^
  652.   	if (r != NULL)
  653.   		{ /* oops, put it back */

crypto/lhash/lhash.c:179:1: Parameter `lh->num_items`
    177.   	}
    178.   
    179. > void *lh_insert(LHASH *lh, void *data)
    180.   	{
    181.   	unsigned long hash;

crypto/x509/x509_vfy.c:654:3: Call
  652.   	if (r != NULL)
  653.   		{ /* oops, put it back */
  654.   		lh_delete(ctx->certs,obj);
           ^
  655.   		X509_OBJECT_free_contents(obj);
  656.   		OPENSSL_free(obj);

crypto/lhash/lhash.c:217:1: <LHS trace>
215.   	}
216.   
217. > void *lh_delete(LHASH *lh, void *data)
218.   	{
219.   	unsigned long hash;

crypto/lhash/lhash.c:217:1: Parameter `lh->num_items`
    215.   	}
    216.   
    217. > void *lh_delete(LHASH *lh, void *data)
    218.   	{
    219.   	unsigned long hash;

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

void *lh_delete(LHASH *lh, void *data)
	{
	unsigned long hash;
	LHASH_NODE *nn,**rn;
	void *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;
		OPENSSL_free(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);
	}
['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_STORE_add_cert(X509_STORE *ctx, X509 *x)\n\t{\n\tX509_OBJECT *obj,*r;\n\tint ret=1;\n\tif (x == NULL) return(0);\n\tobj=(X509_OBJECT *)OPENSSL_malloc(sizeof(X509_OBJECT));\n\tif (obj == NULL)\n\t\t{\n\t\tX509err(X509_F_X509_STORE_ADD_CERT,ERR_R_MALLOC_FAILURE);\n\t\treturn(0);\n\t\t}\n\tobj->type=X509_LU_X509;\n\tobj->data.x509=x;\n\tCRYPTO_w_lock(CRYPTO_LOCK_X509_STORE);\n\tX509_OBJECT_up_ref_count(obj);\n\tr=(X509_OBJECT *)lh_insert(ctx->certs,obj);\n\tif (r != NULL)\n\t\t{\n\t\tlh_delete(ctx->certs,obj);\n\t\tX509_OBJECT_free_contents(obj);\n\t\tOPENSSL_free(obj);\n\t\tlh_insert(ctx->certs,r);\n\t\tX509err(X509_F_X509_STORE_ADD_CERT,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}', 'void *lh_insert(LHASH *lh, void *data)\n\t{\n\tunsigned long hash;\n\tLHASH_NODE *nn,**rn;\n\tvoid *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 *)OPENSSL_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}', 'void *lh_delete(LHASH *lh, void *data)\n\t{\n\tunsigned long hash;\n\tLHASH_NODE *nn,**rn;\n\tvoid *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\tOPENSSL_free(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}']