Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
crypto: unsigned value can't be negative
Browse files Browse the repository at this point in the history
Reviewed-By: Fedor Indutny <fedor@indutny.com>
  • Loading branch information
mscdex authored and indutny committed Sep 2, 2014
1 parent 16b0a33 commit fcfe820
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/node_crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3688,7 +3688,7 @@ void PublicKeyCipher::Cipher(const FunctionCallbackInfo<Value>& args) {
String::Utf8Value passphrase(args[3]);

unsigned char* out_value = NULL;
size_t out_len = -1;
size_t out_len = 0;

bool r = Cipher<operation, EVP_PKEY_cipher_init, EVP_PKEY_cipher>(
kbuf,
Expand All @@ -3700,7 +3700,7 @@ void PublicKeyCipher::Cipher(const FunctionCallbackInfo<Value>& args) {
&out_value,
&out_len);

if (out_len <= 0 || !r) {
if (out_len == 0 || !r) {
delete[] out_value;
out_value = NULL;
out_len = 0;
Expand Down

0 comments on commit fcfe820

Please sign in to comment.