crypto/cms/cms_pwri.c:398: 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:390:14: Call
388.       if (en_de) {
389.   
390.           if (!kek_wrap_key(NULL, &keylen, ec->key, ec->keylen, kekctx))
                    ^
391.               goto err;
392.   

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

crypto/cms/cms_pwri.c:393:15: Call
391.               goto err;
392.   
393.           key = OPENSSL_malloc(keylen);
                     ^
394.   
395.           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:393:9: Assignment
391.               goto err;
392.   
393.           key = OPENSSL_malloc(keylen);
               ^
394.   
395.           if (key == NULL)

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

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

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

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