ssl/ssl_locl.h:694: error: BUFFER_OVERRUN_L3
  Offset: [-1, +oo] Size: [1, +oo] by call to `lh_delete`.
Showing all 10 steps of the trace


ssl/ssl_locl.h:694:1: Parameter `lh->pmax`
692.   };
693.   
694. > DEFINE_LHASH_OF(SSL_SESSION);
695.   
696.   

ssl/ssl_locl.h:694:1: Call
692.   };
693.   
694. > DEFINE_LHASH_OF(SSL_SESSION);
695.   
696.   

crypto/lhash/lhash.c:189:1: Parameter `lh->pmax`
  187.   }
  188.   
  189. > void *lh_delete(_LHASH *lh, const void *data)
  190.   {
  191.       unsigned long hash;

crypto/lhash/lhash.c:212:9: Call
  210.       if ((lh->num_nodes > MIN_NODES) &&
  211.           (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
  212.           contract(lh);
                 ^
  213.   
  214.       return (ret);

crypto/lhash/lhash.c:323:1: <Offset trace>
321.   }
322.   
323. > static void contract(_LHASH *lh)
324.   {
325.       LHASH_NODE **n, *n1, *np;

crypto/lhash/lhash.c:323:1: Parameter `lh->p`
    321.   }
    322.   
    323. > static void contract(_LHASH *lh)
    324.   {
    325.       LHASH_NODE **n, *n1, *np;

crypto/lhash/lhash.c:343:9: Assignment
    341.           lh->b = n;
    342.       } else
    343.           lh->p--;
                   ^
    344.   
    345.       lh->num_nodes--;

crypto/lhash/lhash.c:323:1: <Length trace>
321.   }
322.   
323. > static void contract(_LHASH *lh)
324.   {
325.       LHASH_NODE **n, *n1, *np;

crypto/lhash/lhash.c:323:1: Parameter `*lh->b`
    321.   }
    322.   
    323. > static void contract(_LHASH *lh)
    324.   {
    325.       LHASH_NODE **n, *n1, *np;

crypto/lhash/lhash.c:348:10: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `lh_delete` 
    346.       lh->num_contracts++;
    347.   
    348.       n1 = lh->b[(int)lh->p];
                    ^
    349.       if (n1 == NULL)
    350.           lh->b[(int)lh->p] = np;

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 = 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;
    }
}
['DEFINE_LHASH_OF(SSL_SESSION)', '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 = OPENSSL_realloc(lh->b,\n                            (unsigned int)(sizeof(LHASH_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}']