crypto/lhash/lhash.c:248: error: INTEGER_OVERFLOW_L2
  ([0, `lh->pmax`] - 1):unsigned32.
Showing all 4 steps of the trace


crypto/lhash/lhash.c:231:1: <LHS trace>
229.   }
230.   
231. > static void contract(OPENSSL_LHASH *lh)
232.   {
233.       OPENSSL_LH_NODE **n, *n1, *np;

crypto/lhash/lhash.c:231:1: Parameter `lh->pmax`
229.   }
230.   
231. > static void contract(OPENSSL_LHASH *lh)
232.   {
233.       OPENSSL_LH_NODE **n, *n1, *np;

crypto/lhash/lhash.c:247:9: Assignment
245.           lh->num_contract_reallocs++;
246.           lh->num_alloc_nodes /= 2;
247.           lh->pmax /= 2;
               ^
248.           lh->p = lh->pmax - 1;
249.           lh->b = n;

crypto/lhash/lhash.c:248:9: Binary operation: ([0, lh->pmax] - 1):unsigned32
246.           lh->num_alloc_nodes /= 2;
247.           lh->pmax /= 2;
248.           lh->p = lh->pmax - 1;
               ^
249.           lh->b = n;
250.       } else

static void contract(OPENSSL_LHASH *lh)
{
    OPENSSL_LH_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 = OPENSSL_realloc(lh->b,
                            (unsigned int)(sizeof(OPENSSL_LH_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;
    }
}
['static void contract(OPENSSL_LHASH *lh)\n{\n    OPENSSL_LH_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 = OPENSSL_realloc(lh->b,\n                            (unsigned int)(sizeof(OPENSSL_LH_NODE *) * 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}']