Commit 78ab09a
committed
crypto,quic: add NULL checks for OpenSSL allocation functions
Replace CHECK() assertions with graceful error handling for
EVP_CIPHER_CTX_new() allocation failures.
- src/crypto/crypto_aes.cc: In AES_Cipher(), replace CHECK(ctx)
with early return of WebCryptoCipherStatus::FAILED, matching
the pattern already used in AES_CTR_Cipher2() in the same file.
- src/crypto/crypto_cipher.cc: In CipherBase::CommonInit(),
replace CHECK(ctx_) with ThrowCryptoError(), matching the error
handling pattern used elsewhere in the function.
Note: The other locations mentioned in #62774 (AES_CTR_Cipher2,
TLSSession::Initialize, and ECKeyExportTraits::DoExport) already
have proper NULL checks in the current codebase or have been
refactored such that the relevant code no longer exists.
Fixes: #627741 parent a962e72 commit 78ab09a
2 files changed
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
341 | | - | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
342 | 346 | | |
343 | 347 | | |
344 | 348 | | |
| |||
0 commit comments