Skip to content

Commit

Permalink
Merge pull request #224 from gasbytes/patch-nullhostnamefix
Browse files Browse the repository at this point in the history
Erroring out on invalid port during the creation of a SSLEngine
  • Loading branch information
cconlon authored Sep 30, 2024
2 parents 1d1a4ed + 58ffe89 commit cfbc118
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/java/com/wolfssl/provider/jsse/WolfSSLEngineHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ protected WolfSSLEngineHelper(WolfSSLSession ssl, WolfSSLAuthStore store,
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");
}

Expand Down Expand Up @@ -166,7 +166,7 @@ protected WolfSSLEngineHelper(WolfSSLSession ssl, WolfSSLAuthStore store,
throws WolfSSLException {

if (params == null || ssl == null || store == null ||
peerAddr == null) {
peerAddr == null || port < 0) {
throw new WolfSSLException("Bad argument");
}

Expand Down

0 comments on commit cfbc118

Please sign in to comment.