GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — crypto: handle XOF output allocation failure · nodejs/node@f61408b

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src/crypto
    • crypto_turboshake.cc
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/crypto/crypto_turboshake.cc‎

Copy file name to clipboardExpand all lines: src/crypto/crypto_turboshake.cc
+10-2Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,11 @@ bool TurboShakeTraits::DeriveBits(Environment* env,
469469
CryptoJobMode mode,
470470
CryptoErrorStore* errors) {
471471
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+
}
473477

474478
const uint8_t* input = reinterpret_cast<const uint8_t*>(params.data.data());
475479
size_t input_len = params.data.size();
@@ -595,7 +599,11 @@ bool KangarooTwelveTraits::DeriveBits(Environment* env,
595599
return false;
596600
}
597601

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+
}
599607

600608
switch (params.variant) {
601609
case KangarooTwelveVariant::KT128:

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.