| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 2b4053d commit f61408b
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -469,7 +469,11 @@ bool TurboShakeTraits::DeriveBits(Environment* env, | |||
| 469 | 469 | CryptoJobMode mode, | |
| 470 | 470 | CryptoErrorStore* errors) { | |
| 471 | 471 | CHECK_GT(params.output_length, 0); | |
| 472 | - char* buf = MallocOpenSSL<char>(params.output_length); | ||
| 472 | + char* buf = static_cast<char*>(OPENSSL_malloc(params.output_length)); | ||
| 473 | + if (buf == nullptr) { | ||
| 474 | + errors->Insert(NodeCryptoError::ALLOCATION_FAILED); | ||
| 475 | + return false; | ||
| 476 | + } | ||
| 473 | 477 | ||
| 474 | 478 | const uint8_t* input = reinterpret_cast<const uint8_t*>(params.data.data()); | |
| 475 | 479 | size_t input_len = params.data.size(); | |
@@ -595,7 +599,11 @@ bool KangarooTwelveTraits::DeriveBits(Environment* env, | |||
| 595 | 599 | return false; | |
| 596 | 600 | } | |
| 597 | 601 | ||
| 598 | - char* buf = MallocOpenSSL<char>(params.output_length); | ||
| 602 | + char* buf = static_cast<char*>(OPENSSL_malloc(params.output_length)); | ||
| 603 | + if (buf == nullptr) { | ||
| 604 | + errors->Insert(NodeCryptoError::ALLOCATION_FAILED); | ||
| 605 | + return false; | ||
| 606 | + } | ||
| 599 | 607 | ||
| 600 | 608 | switch (params.variant) { | |
| 601 | 609 | case KangarooTwelveVariant::KT128: | |
| Back | FazBrowse Home | New Git URL |
0 commit comments