crypto/siphash/siphash_pmeth.c:154: error: BUFFER_OVERRUN_L3
  Offset: 15 (⇐ 8 + 7) Size: [0, +oo] by call to `SipHash_Init`.
Showing all 11 steps of the trace


crypto/siphash/siphash_pmeth.c:150:14: Call
148.           }
149.           if (key == NULL || len != SIPHASH_KEY_SIZE ||
150.               !ASN1_OCTET_STRING_set(&pctx->ktmp, key, len))
                    ^
151.               return 0;
152.           /* use default rounds (2,4) */

crypto/asn1/a_octet.c:25:1: Parameter `*x->data`
  23.   }
  24.   
  25. > int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *x, const unsigned char *d,
  26.                             int len)
  27.   {

crypto/asn1/a_octet.c:28:12: Call
  26.                             int len)
  27.   {
  28.       return ASN1_STRING_set(x, d, len);
                   ^
  29.   }

crypto/asn1/asn1_lib.c:264:1: Parameter `*str->data`
    262.   }
    263.   
    264. > int ASN1_STRING_set(ASN1_STRING *str, const void *_data, int len)
    265.   {
    266.       unsigned char *c;

crypto/siphash/siphash_pmeth.c:154:41: Call
152.           /* use default rounds (2,4) */
153.           hash_size = SipHash_hash_size(&pctx->ctx);
154.           return SipHash_Init(&pctx->ctx, ASN1_STRING_get0_data(&pctx->ktmp), hash_size, 0, 0);
                                               ^
155.   
156.       default:

crypto/asn1/asn1_lib.c:374:1: Parameter `*x->data`
  372.   }
  373.   
  374. > const unsigned char *ASN1_STRING_get0_data(const ASN1_STRING *x)
  375.   {
  376.       return x->data;

crypto/asn1/asn1_lib.c:376:5: Assignment
  374.   const unsigned char *ASN1_STRING_get0_data(const ASN1_STRING *x)
  375.   {
  376.       return x->data;
             ^
  377.   }
  378.   

crypto/siphash/siphash_pmeth.c:154:16: Call
152.           /* use default rounds (2,4) */
153.           hash_size = SipHash_hash_size(&pctx->ctx);
154.           return SipHash_Init(&pctx->ctx, ASN1_STRING_get0_data(&pctx->ktmp), hash_size, 0, 0);
                      ^
155.   
156.       default:

crypto/siphash/siphash.c:86:1: <Length trace>
84.   
85.   /* hash_size = crounds = drounds = 0 means SipHash24 with 16-byte output */
86. > int SipHash_Init(SIPHASH *ctx, const unsigned char *k, int hash_size, int crounds, int drounds)
87.   {
88.       uint64_t k0 = U8TO64_LE(k);

crypto/siphash/siphash.c:86:1: Parameter `*k`
  84.   
  85.   /* hash_size = crounds = drounds = 0 means SipHash24 with 16-byte output */
  86. > int SipHash_Init(SIPHASH *ctx, const unsigned char *k, int hash_size, int crounds, int drounds)
  87.   {
  88.       uint64_t k0 = U8TO64_LE(k);

crypto/siphash/siphash.c:89:19: Array access: Offset: 15 (⇐ 8 + 7) Size: [0, +oo] by call to `SipHash_Init` 
  87.   {
  88.       uint64_t k0 = U8TO64_LE(k);
  89.       uint64_t k1 = U8TO64_LE(k + 8);
                          ^
  90.   
  91.       if (hash_size == 0)

int SipHash_Init(SIPHASH *ctx, const unsigned char *k, int hash_size, int crounds, int drounds)
{
    uint64_t k0 = U8TO64_LE(k);
    uint64_t k1 = U8TO64_LE(k + 8);
    if (hash_size == 0)
        hash_size = SIPHASH_MAX_DIGEST_SIZE;
    else if (hash_size != SIPHASH_MIN_DIGEST_SIZE &&
             hash_size != SIPHASH_MAX_DIGEST_SIZE)
        return 0;
    if (drounds == 0)
        drounds = SIPHASH_D_ROUNDS;
    if (crounds == 0)
        crounds = SIPHASH_C_ROUNDS;
    ctx->crounds = crounds;
    ctx->drounds = drounds;
    ctx->hash_size = hash_size;
    ctx->len = 0;
    ctx->total_inlen = 0;
    ctx->v0 = 0x736f6d6570736575ULL ^ k0;
    ctx->v1 = 0x646f72616e646f6dULL ^ k1;
    ctx->v2 = 0x6c7967656e657261ULL ^ k0;
    ctx->v3 = 0x7465646279746573ULL ^ k1;
    if (ctx->hash_size == SIPHASH_MAX_DIGEST_SIZE)
        ctx->v1 ^= 0xee;
    return 1;
}
['static int pkey_siphash_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)\n{\n    SIPHASH_PKEY_CTX *pctx = EVP_PKEY_CTX_get_data(ctx);\n    const unsigned char *key;\n    size_t len;\n    int hash_size;\n    switch (type) {\n    case EVP_PKEY_CTRL_MD:\n        break;\n    case EVP_PKEY_CTRL_SET_DIGEST_SIZE:\n        if (p1 != SIPHASH_MIN_DIGEST_SIZE &&\n            p1 != SIPHASH_MAX_DIGEST_SIZE) {\n            return 0;\n        }\n        return SipHash_Init(&pctx->ctx, ASN1_STRING_get0_data(&pctx->ktmp), p1, 0, 0);\n    case EVP_PKEY_CTRL_SET_MAC_KEY:\n    case EVP_PKEY_CTRL_DIGESTINIT:\n        if (type == EVP_PKEY_CTRL_SET_MAC_KEY) {\n            key = p2;\n            len = p1;\n        } else {\n            key = EVP_PKEY_get0_siphash(EVP_PKEY_CTX_get0_pkey(ctx), &len);\n        }\n        if (key == NULL || len != SIPHASH_KEY_SIZE ||\n            !ASN1_OCTET_STRING_set(&pctx->ktmp, key, len))\n            return 0;\n        hash_size = SipHash_hash_size(&pctx->ctx);\n        return SipHash_Init(&pctx->ctx, ASN1_STRING_get0_data(&pctx->ktmp), hash_size, 0, 0);\n    default:\n        return -2;\n    }\n    return 1;\n}', 'int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *x, const unsigned char *d,\n                          int len)\n{\n    return ASN1_STRING_set(x, d, len);\n}', "int ASN1_STRING_set(ASN1_STRING *str, const void *_data, int len)\n{\n    unsigned char *c;\n    const char *data = _data;\n    if (len < 0) {\n        if (data == NULL)\n            return (0);\n        else\n            len = strlen(data);\n    }\n    if ((str->length <= len) || (str->data == NULL)) {\n        c = str->data;\n        str->data = OPENSSL_realloc(c, len + 1);\n        if (str->data == NULL) {\n            ASN1err(ASN1_F_ASN1_STRING_SET, ERR_R_MALLOC_FAILURE);\n            str->data = c;\n            return (0);\n        }\n    }\n    str->length = len;\n    if (data != NULL) {\n        memcpy(str->data, data, len);\n        str->data[len] = '\\0';\n    }\n    return (1);\n}", 'const unsigned char *ASN1_STRING_get0_data(const ASN1_STRING *x)\n{\n    return x->data;\n}', 'int SipHash_Init(SIPHASH *ctx, const unsigned char *k, int hash_size, int crounds, int drounds)\n{\n    uint64_t k0 = U8TO64_LE(k);\n    uint64_t k1 = U8TO64_LE(k + 8);\n    if (hash_size == 0)\n        hash_size = SIPHASH_MAX_DIGEST_SIZE;\n    else if (hash_size != SIPHASH_MIN_DIGEST_SIZE &&\n             hash_size != SIPHASH_MAX_DIGEST_SIZE)\n        return 0;\n    if (drounds == 0)\n        drounds = SIPHASH_D_ROUNDS;\n    if (crounds == 0)\n        crounds = SIPHASH_C_ROUNDS;\n    ctx->crounds = crounds;\n    ctx->drounds = drounds;\n    ctx->hash_size = hash_size;\n    ctx->len = 0;\n    ctx->total_inlen = 0;\n    ctx->v0 = 0x736f6d6570736575ULL ^ k0;\n    ctx->v1 = 0x646f72616e646f6dULL ^ k1;\n    ctx->v2 = 0x6c7967656e657261ULL ^ k0;\n    ctx->v3 = 0x7465646279746573ULL ^ k1;\n    if (ctx->hash_size == SIPHASH_MAX_DIGEST_SIZE)\n        ctx->v1 ^= 0xee;\n    return 1;\n}']