mirror of
https://github.com/rsyslog/rsyslog.git
synced 2025-12-15 19:50:40 +01:00
Merge pull request #6001 from rgerhards/fix-posisble-garbagge
core/nsd_ptcp: zero addr before getpeername()
This commit is contained in:
commit
a462eb22d9
@ -1036,6 +1036,7 @@ static rsRetVal GetRemotePort(nsd_t *pNsd, int *port) {
|
||||
assert(port != NULL);
|
||||
|
||||
*port = -1; /* Initialize port to -1, indicating no port found initially or on error */
|
||||
memset(&addr, 0, sizeof(addr)); /* avoid potential garbage values */
|
||||
|
||||
if (getpeername(pThis->sock, (struct sockaddr *)&addr, &addrlen) == 0) {
|
||||
if (addr.ss_family == AF_INET6) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user