Skip to content

Commit

Permalink
src,crypto: fix 0-length output crash in webcrypto
Browse files Browse the repository at this point in the history
  • Loading branch information
XadillaX committed Jun 3, 2021
1 parent 21f5a56 commit cab4e62
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/crypto/crypto_cipher.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ class CipherJob final : public CryptoJob<CipherTraits> {
v8::Local<v8::Value>* result) override {
Environment* env = AsyncWrap::env();
CryptoErrorStore* errors = CryptoJob<CipherTraits>::errors();
if (out_.size() > 0) {
if (out_.size() > 0 || (!out_.size() && errors->Empty())) {
CHECK(errors->Empty());
*err = v8::Undefined(env->isolate());
*result = out_.ToArrayBuffer(env);
Expand Down

0 comments on commit cab4e62

Please sign in to comment.