Skip to content

Commit

Permalink
* 修复空指针崩溃
Browse files Browse the repository at this point in the history
  • Loading branch information
weolar committed Nov 22, 2019
1 parent c699489 commit b5a4ce9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions node/openssl/openssl/crypto/lhash/lhash.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,8 @@ static LHASH_NODE **getrn(_LHASH *lh, const void *data, unsigned long *rhash)
cf = lh->comp;
ret = &(lh->b[(int)nn]);
for (n1 = *ret; n1 != NULL; n1 = n1->next) {
if (!n1)
continue;
#ifndef OPENSSL_NO_HASH_COMP
lh->num_hash_comps++;
if (n1->hash != hash) {
Expand Down

2 comments on commit b5a4ce9

@mensong
Copy link

@mensong mensong commented on b5a4ce9 Dec 3, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for (n1 = *ret; n1 != NULL; n1 = n1->next) {
for里面的n1 != NULL不是已经判断过了吗?

@weolar
Copy link
Owner Author

@weolar weolar commented on b5a4ce9 Dec 3, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不用管这里了,现在我发现是因为我用的openssl有点老(1.0.x),这个版本对多线程调用同步做的不好,容易搞出野指针。现在我打算换成boringssl

Please sign in to comment.