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


crypto/mem_dbg.c:650:3: Call
648.   	MemCheck_off(); /* obtains CRYPTO_LOCK_MALLOC2 */
649.   	if (mh != NULL)
650.   		lh_doall_arg(mh,(void (*)())print_leak,(char *)&ml);
         ^
651.   	if (ml.chunks != 0)
652.   		{

crypto/lhash/lhash.c:275:1: <LHS trace>
273.   	}
274.   
275. > void lh_doall_arg(LHASH *lh, void (*func)(), void *arg)
276.   	{
277.   	int i;

crypto/lhash/lhash.c:275:1: Parameter `lh->num_nodes`
  273.   	}
  274.   
  275. > void lh_doall_arg(LHASH *lh, void (*func)(), void *arg)
  276.   	{
  277.   	int i;

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

void lh_doall_arg(LHASH *lh, void (*func)(), 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;
			func(a->data,arg);
			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\tml.bio=b;\n\tml.bytes=0;\n\tml.chunks=0;\n\tMemCheck_off();\n\tif (mh != NULL)\n\t\tlh_doall_arg(mh,(void (*)())print_leak,(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\tCRYPTO_w_lock(CRYPTO_LOCK_MALLOC);\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\tCRYPTO_w_unlock(CRYPTO_LOCK_MALLOC);\n\t\t}\n\tMemCheck_on();\n#if 0\n\tlh_stats_bio(mh,b);\n\tlh_node_stats_bio(mh,b);\n\tlh_node_usage_stats_bio(mh,b);\n#endif\n\t}', 'void lh_doall_arg(LHASH *lh, void (*func)(), 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\tfunc(a->data,arg);\n\t\t\ta=n;\n\t\t\t}\n\t\t}\n\t}']