Browse Source

crypto: unsigned value can't be negative

Reviewed-By: Fedor Indutny <fedor@indutny.com>
v0.11.14-release
Brian White 10 years ago
committed by Fedor Indutny
parent
commit
fcfe820481
  1. 4
      src/node_crypto.cc

4
src/node_crypto.cc

@ -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,
@ -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;

Loading…
Cancel
Save