Skip to content

Commit cfbc118

Browse files
authored
Merge pull request #224 from gasbytes/patch-nullhostnamefix
Erroring out on invalid port during the creation of a SSLEngine
2 parents 1d1a4ed + 58ffe89 commit cfbc118

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/java/com/wolfssl/provider/jsse/WolfSSLEngineHelper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ protected WolfSSLEngineHelper(WolfSSLSession ssl, WolfSSLAuthStore store,
137137
WolfSSLParameters params, int port, String hostname)
138138
throws WolfSSLException {
139139

140-
if (params == null || ssl == null || store == null) {
140+
if (params == null || ssl == null || store == null || port < 0) {
141141
throw new WolfSSLException("Bad argument");
142142
}
143143

@@ -166,7 +166,7 @@ protected WolfSSLEngineHelper(WolfSSLSession ssl, WolfSSLAuthStore store,
166166
throws WolfSSLException {
167167

168168
if (params == null || ssl == null || store == null ||
169-
peerAddr == null) {
169+
peerAddr == null || port < 0) {
170170
throw new WolfSSLException("Bad argument");
171171
}
172172

0 commit comments

Comments
 (0)