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


crypto/mem_dbg.c:603:18: Call
601.   
602.               m.addr = addr1;
603.               mp = lh_MEM_delete(mh, &m);
                        ^
604.               if (mp != NULL) {
605.   #ifdef LEVITTE_DEBUG_MEM

crypto/lhash/lhash.c:213:1: Parameter `lh->pmax`
  211.   }
  212.   
  213. > void *lh_delete(_LHASH *lh, const void *data)
  214.   {
  215.       unsigned long hash;

crypto/lhash/lhash.c:236:9: Call
  234.       if ((lh->num_nodes > MIN_NODES) &&
  235.           (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
  236.           contract(lh);
                 ^
  237.   
  238.       return (ret);

crypto/lhash/lhash.c:354:1: <LHS trace>
352.   }
353.   
354. > static void contract(_LHASH *lh)
355.   {
356.       LHASH_NODE **n, *n1, *np;

crypto/lhash/lhash.c:354:1: Parameter `lh->p`
    352.   }
    353.   
    354. > static void contract(_LHASH *lh)
    355.   {
    356.       LHASH_NODE **n, *n1, *np;

crypto/lhash/lhash.c:358:10: Binary operation: ([0, +oo] - 1):unsigned32 by call to `lh_delete` 
    356.       LHASH_NODE **n, *n1, *np;
    357.   
    358.       np = lh->b[lh->p + lh->pmax - 1];
                    ^
    359.       lh->b[lh->p + lh->pmax - 1] = NULL; /* 24/07-92 - eay - weird but :-( */
    360.       if (lh->p == 0) {

static void contract(_LHASH *lh)
{
    LHASH_NODE **n, *n1, *np;
    np = lh->b[lh->p + lh->pmax - 1];
    lh->b[lh->p + lh->pmax - 1] = NULL;
    if (lh->p == 0) {
        n = (LHASH_NODE **)OPENSSL_realloc(lh->b,
                                           (unsigned int)(sizeof(LHASH_NODE *)
                                                          * lh->pmax));
        if (n == NULL) {
            lh->error++;
            return;
        }
        lh->num_contract_reallocs++;
        lh->num_alloc_nodes /= 2;
        lh->pmax /= 2;
        lh->p = lh->pmax - 1;
        lh->b = n;
    } else
        lh->p--;
    lh->num_nodes--;
    lh->num_contracts++;
    n1 = lh->b[(int)lh->p];
    if (n1 == NULL)
        lh->b[(int)lh->p] = np;
    else {
        while (n1->next != NULL)
            n1 = n1->next;
        n1->next = np;
    }
}
['void CRYPTO_dbg_realloc(void *addr1, void *addr2, int num,\n                        const char *file, int line, int before_p)\n{\n    MEM m, *mp;\n#ifdef LEVITTE_DEBUG_MEM\n    fprintf(stderr,\n            "LEVITTE_DEBUG_MEM: --> CRYPTO_dbg_malloc(addr1 = %p, addr2 = %p, num = %d, file = \\"%s\\", line = %d, before_p = %d)\\n",\n            addr1, addr2, num, file, line, before_p);\n#endif\n    switch (before_p) {\n    case 0:\n        break;\n    case 1:\n        if (addr2 == NULL)\n            break;\n        if (addr1 == NULL) {\n            CRYPTO_dbg_malloc(addr2, num, file, line, 128 | before_p);\n            break;\n        }\n        if (is_MemCheck_on()) {\n            MemCheck_off();\n            m.addr = addr1;\n            mp = lh_MEM_delete(mh, &m);\n            if (mp != NULL) {\n#ifdef LEVITTE_DEBUG_MEM\n                fprintf(stderr,\n                        "LEVITTE_DEBUG_MEM: [%5ld] * 0x%p (%d) -> 0x%p (%d)\\n",\n                        mp->order, mp->addr, mp->num, addr2, num);\n#endif\n                mp->addr = addr2;\n                mp->num = num;\n                (void)lh_MEM_insert(mh, mp);\n            }\n            MemCheck_on();\n        }\n        break;\n    }\n    return;\n}', 'void *lh_delete(_LHASH *lh, const void *data)\n{\n    unsigned long hash;\n    LHASH_NODE *nn, **rn;\n    void *ret;\n    lh->error = 0;\n    rn = getrn(lh, data, &hash);\n    if (*rn == NULL) {\n        lh->num_no_delete++;\n        return (NULL);\n    } else {\n        nn = *rn;\n        *rn = nn->next;\n        ret = nn->data;\n        OPENSSL_free(nn);\n        lh->num_delete++;\n    }\n    lh->num_items--;\n    if ((lh->num_nodes > MIN_NODES) &&\n        (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))\n        contract(lh);\n    return (ret);\n}', 'static void contract(_LHASH *lh)\n{\n    LHASH_NODE **n, *n1, *np;\n    np = lh->b[lh->p + lh->pmax - 1];\n    lh->b[lh->p + lh->pmax - 1] = NULL;\n    if (lh->p == 0) {\n        n = (LHASH_NODE **)OPENSSL_realloc(lh->b,\n                                           (unsigned int)(sizeof(LHASH_NODE *)\n                                                          * lh->pmax));\n        if (n == NULL) {\n            lh->error++;\n            return;\n        }\n        lh->num_contract_reallocs++;\n        lh->num_alloc_nodes /= 2;\n        lh->pmax /= 2;\n        lh->p = lh->pmax - 1;\n        lh->b = n;\n    } else\n        lh->p--;\n    lh->num_nodes--;\n    lh->num_contracts++;\n    n1 = lh->b[(int)lh->p];\n    if (n1 == NULL)\n        lh->b[(int)lh->p] = np;\n    else {\n        while (n1->next != NULL)\n            n1 = n1->next;\n        n1->next = np;\n    }\n}']