Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

crypto: fix 'var may be used uninitialized' compiler warnings

  • Loading branch information...
bnoordhuis committed Nov 15, 2011
1 parent b9e1bb3 commit cf2ee19049a3e2d87e48b3910a0fab6e8d4988e1
Showing with 15 additions and 6 deletions.
  1. +15 −6 src/node_crypto.cc
@@ -2156,14 +2156,17 @@ class Cipher : public ObjectWrap {

HandleScope scope;

unsigned char* out_value;
int out_len;
unsigned char* out_value = NULL;
int out_len = -1;
char* out_hexdigest;
int out_hex_len;
Local<Value> outString ;

int r = cipher->CipherFinal(&out_value, &out_len);

assert(out_value != NULL);
assert(out_len != -1);

if (out_len == 0 || r == 0) {
return scope.Close(String::New(""));
}
@@ -2576,12 +2579,15 @@ class Decipher : public ObjectWrap {

Decipher *cipher = ObjectWrap::Unwrap<Decipher>(args.This());

unsigned char* out_value;
int out_len;
unsigned char* out_value = NULL;
int out_len = -1;
Local<Value> outString;

int r = cipher->DecipherFinal(&out_value, &out_len, false);

assert(out_value != NULL);
assert(out_len != -1);

if (out_len == 0 || r == 0) {
return scope.Close(String::New(""));
}
@@ -2826,14 +2832,17 @@ class Hmac : public ObjectWrap {

HandleScope scope;

unsigned char* md_value;
unsigned int md_len;
unsigned char* md_value = NULL;
unsigned int md_len = -1;
char* md_hexdigest;
int md_hex_len;
Local<Value> outString ;

int r = hmac->HmacDigest(&md_value, &md_len);

assert(md_value != NULL);
assert(md_len != -1);

if (md_len == 0 || r == 0) {
return scope.Close(String::New(""));
}

0 comments on commit cf2ee19

Please sign in to comment.
You can’t perform that action at this time.