From fcfe820481fa1d167d4d4a9a487036cbd447fb05 Mon Sep 17 00:00:00 2001 From: Brian White Date: Tue, 2 Sep 2014 09:27:33 -0400 Subject: [PATCH] crypto: unsigned value can't be negative Reviewed-By: Fedor Indutny --- src/node_crypto.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 329ca9c4bb..1b72d723c8 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -3688,7 +3688,7 @@ void PublicKeyCipher::Cipher(const FunctionCallbackInfo& args) { String::Utf8Value passphrase(args[3]); unsigned char* out_value = NULL; - size_t out_len = -1; + size_t out_len = 0; bool r = Cipher( kbuf, @@ -3700,7 +3700,7 @@ void PublicKeyCipher::Cipher(const FunctionCallbackInfo& args) { &out_value, &out_len); - if (out_len <= 0 || !r) { + if (out_len == 0 || !r) { delete[] out_value; out_value = NULL; out_len = 0;