Skip to content

Commit 877d622

Browse files
authored
Throw NPE when SSL.setOcspResponse(...) is invoked with null argument (#1006)
Motivation: Let's guard against passing in a null argument which would previously crash. Modifications: Throw NPE on null argument Result: More robust code
1 parent 0c5069f commit 877d622

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

  • openssl-dynamic/src/main/c

‎openssl-dynamic/src/main/c/ssl.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2486,6 +2486,11 @@ TCN_IMPLEMENT_CALL(void, SSL, setOcspResponse)(TCN_STDARGS, jlong ssl, jbyteArra
24862486

24872487
TCN_CHECK_NULL(ssl_, ssl, /* void */);
24882488

2489+
if (response == NULL) {
2490+
tcn_ThrowNullPointerException(e, "response");
2491+
return;
2492+
}
2493+
24892494
jsize length = (*e)->GetArrayLength(e, response);
24902495
if (length <= 0) {
24912496
return;

0 commit comments

Comments
 (0)