diff options
author | Rich Trott <rtrott@gmail.com> | 2016-09-16 22:45:00 -0700 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2016-09-21 22:47:33 -0700 |
commit | d2eb7ce0105369a9cad82787cb33a665e9bd00ad (patch) | |
tree | 1bf8e4caca2d4fa073263773d82114de6e0f80eb /test/parallel/test-crypto-pbkdf2.js | |
parent | 7b7d50a29e098cea525892ad51e61cfa2897e8b8 (diff) | |
download | android-node-v8-d2eb7ce0105369a9cad82787cb33a665e9bd00ad.tar.gz android-node-v8-d2eb7ce0105369a9cad82787cb33a665e9bd00ad.tar.bz2 android-node-v8-d2eb7ce0105369a9cad82787cb33a665e9bd00ad.zip |
src: Malloc/Calloc size 0 returns non-null pointer
Change `Malloc()/Calloc()` so that size zero does not return a null
pointer, consistent with prior behavior.
Fixes: https://github.com/nodejs/node/issues/8571
PR-URL: https://github.com/nodejs/node/pull/8572
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@keybase.io>
Reviewed-By: Yorkie Liu <yorkiefixer@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Diffstat (limited to 'test/parallel/test-crypto-pbkdf2.js')
-rw-r--r-- | test/parallel/test-crypto-pbkdf2.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/parallel/test-crypto-pbkdf2.js b/test/parallel/test-crypto-pbkdf2.js index c1897c2d69..f9fa7aa486 100644 --- a/test/parallel/test-crypto-pbkdf2.js +++ b/test/parallel/test-crypto-pbkdf2.js @@ -84,3 +84,11 @@ assert.throws(function() { assert.throws(function() { crypto.pbkdf2('password', 'salt', 1, 4073741824, 'sha256', common.fail); }, /Bad key length/); + +// Should not get FATAL ERROR with empty password and salt +// https://github.com/nodejs/node/issues/8571 +assert.doesNotThrow(() => { + crypto.pbkdf2('', '', 1, 32, 'sha256', common.mustCall((e) => { + assert.ifError(e); + })); +}); |