Merge pull request #224 from gasbytes/patch-nullhostnamefix

Erroring out on invalid port during the creation of a SSLEngine
pull/225/head
Chris Conlon 2024-09-30 10:01:25 -06:00 committed by GitHub
commit cfbc118cc7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -137,7 +137,7 @@ public class WolfSSLEngineHelper {
WolfSSLParameters params, int port, String hostname)
throws WolfSSLException {
if (params == null || ssl == null || store == null) {
if (params == null || ssl == null || store == null || port < 0) {
throw new WolfSSLException("Bad argument");
}
@ -166,7 +166,7 @@ public class WolfSSLEngineHelper {
throws WolfSSLException {
if (params == null || ssl == null || store == null ||
peerAddr == null) {
peerAddr == null || port < 0) {
throw new WolfSSLException("Bad argument");
}