crypto/mem_dbg.c:680: error: INTEGER_OVERFLOW_L2
  ([0, +oo] - 1):unsigned32 by call to `lh_doall_arg`.
Showing all 6 steps of the trace


crypto/mem_dbg.c:680:3: Call
678.   	ml.chunks=0;
679.   	if (mh != NULL)
680.   		lh_doall_arg(mh, LHASH_DOALL_ARG_FN(print_leak),
         ^
681.   				(char *)&ml);
682.   	if (ml.chunks != 0)

crypto/lhash/lhash.c:300:1: Parameter `lh->num_nodes`
  298.   	}
  299.   
  300. > void lh_doall_arg(LHASH *lh, LHASH_DOALL_ARG_FN_TYPE func, const void *arg)
  301.   	{
  302.   	doall_util_fn(lh, 1, (LHASH_DOALL_FN_TYPE)0, func, arg);

crypto/lhash/lhash.c:302:2: Call
  300.   void lh_doall_arg(LHASH *lh, LHASH_DOALL_ARG_FN_TYPE func, const void *arg)
  301.   	{
  302.   	doall_util_fn(lh, 1, (LHASH_DOALL_FN_TYPE)0, func, arg);
          ^
  303.   	}
  304.   

crypto/lhash/lhash.c:270:1: <LHS trace>
268.   	}
269.   
270. > static void doall_util_fn(LHASH *lh, int use_arg, LHASH_DOALL_FN_TYPE func,
271.   			LHASH_DOALL_ARG_FN_TYPE func_arg, const void *arg)
272.   	{

crypto/lhash/lhash.c:270:1: Parameter `lh->num_nodes`
    268.   	}
    269.   
    270. > static void doall_util_fn(LHASH *lh, int use_arg, LHASH_DOALL_FN_TYPE func,
    271.   			LHASH_DOALL_ARG_FN_TYPE func_arg, const void *arg)
    272.   	{

crypto/lhash/lhash.c:278:7: Binary operation: ([0, +oo] - 1):unsigned32 by call to `lh_doall_arg` 
    276.   	/* reverse the order so we search from 'top to bottom'
    277.   	 * We were having memory leaks otherwise */
    278.   	for (i=lh->num_nodes-1; i>=0; i--)
                 ^
    279.   		{
    280.   		a=lh->b[i];

static void doall_util_fn(LHASH *lh, int use_arg, LHASH_DOALL_FN_TYPE func,
			LHASH_DOALL_ARG_FN_TYPE func_arg, const void *arg)
	{
	int i;
	LHASH_NODE *a,*n;
	for (i=lh->num_nodes-1; i>=0; i--)
		{
		a=lh->b[i];
		while (a != NULL)
			{
			n=a->next;
			if(use_arg)
				func_arg(a->data,arg);
			else
				func(a->data);
			a=n;
			}
		}
	}
['void CRYPTO_mem_leaks(BIO *b)\n\t{\n\tMEM_LEAK ml;\n\tchar buf[80];\n\tif (mh == NULL && amih == NULL)\n\t\treturn;\n\tMemCheck_off();\n\tml.bio=b;\n\tml.bytes=0;\n\tml.chunks=0;\n\tif (mh != NULL)\n\t\tlh_doall_arg(mh, LHASH_DOALL_ARG_FN(print_leak),\n\t\t\t\t(char *)&ml);\n\tif (ml.chunks != 0)\n\t\t{\n\t\tsprintf(buf,"%ld bytes leaked in %d chunks\\n",\n\t\t\tml.bytes,ml.chunks);\n\t\tBIO_puts(b,buf);\n\t\t}\n\telse\n\t\t{\n\t\tint old_mh_mode;\n\t\tCRYPTO_w_lock(CRYPTO_LOCK_MALLOC);\n\t\told_mh_mode = mh_mode;\n\t\tmh_mode = CRYPTO_MEM_CHECK_OFF;\n\t\tif (mh != NULL)\n\t\t\t{\n\t\t\tlh_free(mh);\n\t\t\tmh = NULL;\n\t\t\t}\n\t\tif (amih != NULL)\n\t\t\t{\n\t\t\tif (lh_num_items(amih) == 0)\n\t\t\t\t{\n\t\t\t\tlh_free(amih);\n\t\t\t\tamih = NULL;\n\t\t\t\t}\n\t\t\t}\n\t\tmh_mode = old_mh_mode;\n\t\tCRYPTO_w_unlock(CRYPTO_LOCK_MALLOC);\n\t\t}\n\tMemCheck_on();\n\t}', 'void lh_doall_arg(LHASH *lh, LHASH_DOALL_ARG_FN_TYPE func, const void *arg)\n\t{\n\tdoall_util_fn(lh, 1, (LHASH_DOALL_FN_TYPE)0, func, arg);\n\t}', 'static void doall_util_fn(LHASH *lh, int use_arg, LHASH_DOALL_FN_TYPE func,\n\t\t\tLHASH_DOALL_ARG_FN_TYPE func_arg, const void *arg)\n\t{\n\tint i;\n\tLHASH_NODE *a,*n;\n\tfor (i=lh->num_nodes-1; i>=0; i--)\n\t\t{\n\t\ta=lh->b[i];\n\t\twhile (a != NULL)\n\t\t\t{\n\t\t\tn=a->next;\n\t\t\tif(use_arg)\n\t\t\t\tfunc_arg(a->data,arg);\n\t\t\telse\n\t\t\t\tfunc(a->data);\n\t\t\ta=n;\n\t\t\t}\n\t\t}\n\t}']