crypto/cms/cms_pwri.c:397: error: BUFFER_OVERRUN_L3
  Offset: 3 Size: [1, +oo] by call to `kek_wrap_key`.
Showing all 9 steps of the trace


crypto/cms/cms_pwri.c:389:14: Call
387.       if (en_de) {
388.   
389.           if (!kek_wrap_key(NULL, &keylen, ec->key, ec->keylen, &kekctx))
                    ^
390.               goto err;
391.   

crypto/cms/cms_pwri.c:274:1: Parameter `*outlen`
  272.   }
  273.   
  274. > static int kek_wrap_key(unsigned char *out, size_t *outlen,
  275.                           const unsigned char *in, size_t inlen,
  276.                           EVP_CIPHER_CTX *ctx)

crypto/cms/cms_pwri.c:392:15: Call
390.               goto err;
391.   
392.           key = OPENSSL_malloc(keylen);
                     ^
393.   
394.           if (key == NULL)

crypto/mem.c:125:9: Assignment
  123.   
  124.       if (num <= 0)
  125.           return NULL;
                 ^
  126.   
  127.       allow_customize = 0;

crypto/cms/cms_pwri.c:392:9: Assignment
390.               goto err;
391.   
392.           key = OPENSSL_malloc(keylen);
               ^
393.   
394.           if (key == NULL)

crypto/cms/cms_pwri.c:397:14: Call
395.               goto err;
396.   
397.           if (!kek_wrap_key(key, &keylen, ec->key, ec->keylen, &kekctx))
                    ^
398.               goto err;
399.           pwri->encryptedKey->data = key;

crypto/cms/cms_pwri.c:274:1: <Length trace>
272.   }
273.   
274. > static int kek_wrap_key(unsigned char *out, size_t *outlen,
275.                           const unsigned char *in, size_t inlen,
276.                           EVP_CIPHER_CTX *ctx)

crypto/cms/cms_pwri.c:274:1: Parameter `*out`
  272.   }
  273.   
  274. > static int kek_wrap_key(unsigned char *out, size_t *outlen,
  275.                           const unsigned char *in, size_t inlen,
  276.                           EVP_CIPHER_CTX *ctx)

crypto/cms/cms_pwri.c:300:9: Array access: Offset: 3 Size: [1, +oo] by call to `kek_wrap_key` 
  298.           out[1] = in[0] ^ 0xFF;
  299.           out[2] = in[1] ^ 0xFF;
  300.           out[3] = in[2] ^ 0xFF;
                 ^
  301.           memcpy(out + 4, in, inlen);
  302.           /* Add random padding to end */
