diff options
-rw-r--r-- | src/responder/nss/nsssrv_services.c | 2 | ||||
-rw-r--r-- | src/sss_client/nss_services.c | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/responder/nss/nsssrv_services.c b/src/responder/nss/nsssrv_services.c index db8a2ca1..2e539f13 100644 --- a/src/responder/nss/nsssrv_services.c +++ b/src/responder/nss/nsssrv_services.c @@ -1050,7 +1050,7 @@ errno_t parse_getservbyport(TALLOC_CTX *mem_ctx, SAFEALIGN_COPY_UINT16(&c, body, NULL); port = ntohs(c); - port_and_padding_len = 2 * sizeof(uint16_t); + port_and_padding_len = 2 * sizeof(uint16_t) + sizeof(uint32_t); i = port_and_padding_len; j = 0; diff --git a/src/sss_client/nss_services.c b/src/sss_client/nss_services.c index 8f25781a..159583d7 100644 --- a/src/sss_client/nss_services.c +++ b/src/sss_client/nss_services.c @@ -54,8 +54,8 @@ static void sss_nss_getservent_data_clean(void) { * * GETSERVBYPORT Request: * 0-3: 16-bit port number in network byte order - * 4-7: Reserved/padding - * 8-X: Zero-terminated string (protocol) + * 4-15: Reserved/padding + * 16-X: Zero-terminated string (protocol) * Protocol may be zero-length to imply "any" * * Replies: @@ -297,6 +297,7 @@ _nss_sss_getservbyport_r(int port, const char *protocol, /* Padding */ SAFEALIGN_SET_UINT16(data + p, 0, &p); + SAFEALIGN_SET_UINT32(data + p, 0, &p); if (protocol) { memcpy(data + p, protocol, proto_len + 1); |