Skip to content

Commit

Permalink
Bug_2233740 Fix wrong port number in log and audit
Browse files Browse the repository at this point in the history
If the connection is created from a java socket the port number was
reported incorrectly because a conversion from host to network format
was missed.
  • Loading branch information
fmarco76 committed Sep 5, 2023
1 parent ac5a2a2 commit a9b35eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions native/src/main/native/org/mozilla/jss/ssl/javasock.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,11 +365,11 @@ getInetAddress(PRFileDesc *fd, PRNetAddr *addr, LocalOrPeer localOrPeer)
if (addrBALen == 4) {
memcpy( (void*) &addr->inet.ip, addrBytes, 4);
addr->inet.family = PR_AF_INET;
addr->inet.port = port;
addr->inet.port = PR_htons(port);
} else {
memcpy( (void*) &addr->ipv6.ip,addrBytes, 16);
addr->inet.family = PR_AF_INET6;
addr->inet.port = port;
addr->inet.port = PR_htons(port);
}

JSS_DerefByteArray(env, addrByteArray, addrBytes, JNI_ABORT);
Expand Down

0 comments on commit a9b35eb

Please sign in to comment.