crypto/evp/evp_fetch.c:124: error: INTEGER_OVERFLOW_L2
  ([0, +oo] - 1):unsigned64 by call to `ossl_method_store_add`.
Showing all 10 steps of the trace


crypto/evp/evp_fetch.c:124:12: Call
122.   
123.       if (methdata->refcnt_up_method(method)
124.           && ossl_method_store_add(store, nid, propdef, method,
                  ^
125.                                    methdata->destruct_method))
126.           return 1;

crypto/property/property.c:187:1: Parameter `store->algs->nelem`
  185.   }
  186.   
  187. > int ossl_method_store_add(OSSL_METHOD_STORE *store,
  188.                             int nid, const char *properties,
  189.                             void *method, void (*method_destruct)(void *))

crypto/property/property.c:228:14: Call
  226.               goto err;
  227.           alg->nid = nid;
  228.           if (!ossl_method_store_insert(store, alg))
                      ^
  229.               goto err;
  230.       }

crypto/property/property.c:182:1: Parameter `store->algs->nelem`
    180.   }
    181.   
    182. > static int ossl_method_store_insert(OSSL_METHOD_STORE *store, ALGORITHM *alg)
    183.   {
    184.           return ossl_sa_ALGORITHM_set(store->algs, alg->nid, alg);

crypto/property/property.c:184:16: Call
    182.   static int ossl_method_store_insert(OSSL_METHOD_STORE *store, ALGORITHM *alg)
    183.   {
    184.           return ossl_sa_ALGORITHM_set(store->algs, alg->nid, alg);
                          ^
    185.   }
    186.   

crypto/property/property.c:65:1: Parameter `sa->nelem`
      63.   } IMPL_CACHE_FLUSH;
      64.   
      65. > DEFINE_SPARSE_ARRAY_OF(ALGORITHM);
      66.   
      67.   static void ossl_method_cache_flush(OSSL_METHOD_STORE *store, int nid);

crypto/property/property.c:65:1: Call
      63.   } IMPL_CACHE_FLUSH;
      64.   
      65. > DEFINE_SPARSE_ARRAY_OF(ALGORITHM);
      66.   
      67.   static void ossl_method_cache_flush(OSSL_METHOD_STORE *store, int nid);

crypto/sparse_array.c:183:1: <LHS trace>
181.   }
182.   
183. > int OPENSSL_SA_set(OPENSSL_SA *sa, ossl_uintmax_t posn, void *val)
184.   {
185.       int i, level = 1;

crypto/sparse_array.c:183:1: Parameter `sa->nelem`
        181.   }
        182.   
        183. > int OPENSSL_SA_set(OPENSSL_SA *sa, ossl_uintmax_t posn, void *val)
        184.   {
        185.       int i, level = 1;

crypto/sparse_array.c:215:9: Binary operation: ([0, +oo] - 1):unsigned64 by call to `ossl_method_store_add` 
        213.       p += posn & SA_BLOCK_MASK;
        214.       if (val == NULL && *p != NULL)
        215.           sa->nelem--;
                       ^
        216.       else if (val != NULL && *p == NULL)
        217.           sa->nelem++;

int OPENSSL_SA_set(OPENSSL_SA *sa, ossl_uintmax_t posn, void *val)
{
    int i, level = 1;
    ossl_uintmax_t n = posn;
    void **p;
    if (sa == NULL)
        return 0;
    for (level = 1; level < SA_BLOCK_MAX_LEVELS; level++)
        if ((n >>= OPENSSL_SA_BLOCK_BITS) == 0)
            break;
    for (;sa->levels < level; sa->levels++) {
        p = alloc_node();
        if (p == NULL)
            return 0;
        p[0] = sa->nodes;
        sa->nodes = p;
    }
    if (sa->top < posn)
        sa->top = posn;
    p = sa->nodes;
    for (level = sa->levels - 1; level > 0; level--) {
        i = (posn >> (OPENSSL_SA_BLOCK_BITS * level)) & SA_BLOCK_MASK;
        if (p[i] == NULL && (p[i] = alloc_node()) == NULL)
            return 0;
        p = p[i];
    }
    p += posn & SA_BLOCK_MASK;
    if (val == NULL && *p != NULL)
        sa->nelem--;
    else if (val != NULL && *p == NULL)
        sa->nelem++;
    *p = val;
    return 1;
}
['static int put_method_in_store(OPENSSL_CTX *libctx, void *store,\n                               const char *propdef,\n                               void *method, void *data)\n{\n    struct method_data_st *methdata = data;\n    int nid = methdata->nid_method(method);\n    if (nid == NID_undef)\n        return 0;\n    if (store == NULL\n        && (store = get_default_method_store(libctx)) == NULL)\n        return 0;\n    if (methdata->refcnt_up_method(method)\n        && ossl_method_store_add(store, nid, propdef, method,\n                                 methdata->destruct_method))\n        return 1;\n    return 0;\n}', 'int ossl_method_store_add(OSSL_METHOD_STORE *store,\n                          int nid, const char *properties,\n                          void *method, void (*method_destruct)(void *))\n{\n    ALGORITHM *alg = NULL;\n    IMPLEMENTATION *impl;\n    int ret = 0;\n    if (nid <= 0 || method == NULL || store == NULL)\n        return 0;\n    if (properties == NULL)\n        properties = "";\n    impl = OPENSSL_malloc(sizeof(*impl));\n    if (impl == NULL)\n        return 0;\n    impl->method = method;\n    impl->method_destruct = method_destruct;\n    ossl_property_write_lock(store);\n    ossl_method_cache_flush(store, nid);\n    if ((impl->properties = ossl_prop_defn_get(properties)) == NULL) {\n        if ((impl->properties = ossl_parse_property(properties)) == NULL)\n            goto err;\n        ossl_prop_defn_set(properties, impl->properties);\n    }\n    alg = ossl_method_store_retrieve(store, nid);\n    if (alg == NULL) {\n        if ((alg = OPENSSL_zalloc(sizeof(*alg))) == NULL\n                || (alg->impls = sk_IMPLEMENTATION_new_null()) == NULL\n                || (alg->cache = lh_QUERY_new(&query_hash, &query_cmp)) == NULL)\n            goto err;\n        alg->nid = nid;\n        if (!ossl_method_store_insert(store, alg))\n            goto err;\n    }\n    if (sk_IMPLEMENTATION_push(alg->impls, impl))\n        ret = 1;\n    ossl_property_unlock(store);\n    if (ret == 0)\n        impl_free(impl);\n    return ret;\nerr:\n    ossl_property_unlock(store);\n    alg_cleanup(0, alg);\n    impl_free(impl);\n    return 0;\n}', 'static int ossl_method_store_insert(OSSL_METHOD_STORE *store, ALGORITHM *alg)\n{\n        return ossl_sa_ALGORITHM_set(store->algs, alg->nid, alg);\n}', 'DEFINE_SPARSE_ARRAY_OF(ALGORITHM)', 'int OPENSSL_SA_set(OPENSSL_SA *sa, ossl_uintmax_t posn, void *val)\n{\n    int i, level = 1;\n    ossl_uintmax_t n = posn;\n    void **p;\n    if (sa == NULL)\n        return 0;\n    for (level = 1; level < SA_BLOCK_MAX_LEVELS; level++)\n        if ((n >>= OPENSSL_SA_BLOCK_BITS) == 0)\n            break;\n    for (;sa->levels < level; sa->levels++) {\n        p = alloc_node();\n        if (p == NULL)\n            return 0;\n        p[0] = sa->nodes;\n        sa->nodes = p;\n    }\n    if (sa->top < posn)\n        sa->top = posn;\n    p = sa->nodes;\n    for (level = sa->levels - 1; level > 0; level--) {\n        i = (posn >> (OPENSSL_SA_BLOCK_BITS * level)) & SA_BLOCK_MASK;\n        if (p[i] == NULL && (p[i] = alloc_node()) == NULL)\n            return 0;\n        p = p[i];\n    }\n    p += posn & SA_BLOCK_MASK;\n    if (val == NULL && *p != NULL)\n        sa->nelem--;\n    else if (val != NULL && *p == NULL)\n        sa->nelem++;\n    *p = val;\n    return 1;\n}']