mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
crypto: fix 'var may be used uninitialized' compiler warnings
This commit is contained in:
1 parent
b9e1bb3d92
commit
cf2ee19049
1 file changed
+15
-6
+15
-6
@@ -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(""));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user