projects
/
platform
/
upstream
/
nodejs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
92419f8
)
crypto: avoid memory leak
author
Brian White
<mscdex@mscdex.net>
Tue, 2 Sep 2014 13:26:14 +0000
(09:26 -0400)
committer
Fedor Indutny
<fedor@indutny.com>
Tue, 2 Sep 2014 13:41:21 +0000
(17:41 +0400)
Reviewed-By: Fedor Indutny <fedor@indutny.com>
src/node_crypto.cc
patch
|
blob
|
history
diff --git
a/src/node_crypto.cc
b/src/node_crypto.cc
index
a922be6
..
329ca9c
100644
(file)
--- a/
src/node_crypto.cc
+++ b/
src/node_crypto.cc
@@
-4506,13
+4506,14
@@
void PBKDF2(const FunctionCallbackInfo<Value>& args) {
goto err;
}
+ ASSERT_IS_BUFFER(args[1]);
+
pass = static_cast<char*>(malloc(passlen));
if (pass == NULL) {
FatalError("node::PBKDF2()", "Out of Memory");
}
memcpy(pass, Buffer::Data(args[0]), passlen);
- ASSERT_IS_BUFFER(args[1]);
saltlen = Buffer::Length(args[1]);
if (saltlen < 0) {
type_error = "Bad salt";