diff options
| -rw-r--r-- | src/lib/libcrypto/cms/cms_pwri.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/libcrypto/cms/cms_pwri.c b/src/lib/libcrypto/cms/cms_pwri.c index d282d1d42f..36a53568d1 100644 --- a/src/lib/libcrypto/cms/cms_pwri.c +++ b/src/lib/libcrypto/cms/cms_pwri.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: cms_pwri.c,v 1.36 2026/06/09 12:12:34 tb Exp $ */ | 1 | /* $OpenBSD: cms_pwri.c,v 1.37 2026/06/09 12:20:34 tb Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 3 | * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
| 4 | * project. | 4 | * project. |
| @@ -232,6 +232,10 @@ kek_unwrap_key(unsigned char *out, size_t *outlen, const unsigned char *in, | |||
| 232 | unsigned char *tmp; | 232 | unsigned char *tmp; |
| 233 | int outl, rv = 0; | 233 | int outl, rv = 0; |
| 234 | 234 | ||
| 235 | /* Ensure inlen is large enough that tmp[6] is in bounds. */ | ||
| 236 | if (blocklen < 4) | ||
| 237 | return 0; | ||
| 238 | |||
| 235 | if (inlen < 2 * blocklen) { | 239 | if (inlen < 2 * blocklen) { |
| 236 | /* too small */ | 240 | /* too small */ |
| 237 | return 0; | 241 | return 0; |
