From 56e4822566743a42a3e20cc9dc969826969ba156 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Matthias=20Dieter=20Walln=C3=B6fer?= Date: Thu, 17 Jun 2010 09:42:17 +0200 Subject: [PATCH] s4:dcesrv_netr_DsRAddressToSitenamesExW - fix the detection of the address family in a better way Obviously the last attempt wasn't enough. Now we do really only read the first byte in the address buffer which on little endian transmission does always contain the address family (MS-NRPC 2.2.1.2.4.1). This should now be working platform-independently. --- source4/rpc_server/netlogon/dcerpc_netlogon.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source4/rpc_server/netlogon/dcerpc_netlogon.c b/source4/rpc_server/netlogon/dcerpc_netlogon.c index b1ac5836f3..28e517f0c9 100644 --- a/source4/rpc_server/netlogon/dcerpc_netlogon.c +++ b/source4/rpc_server/netlogon/dcerpc_netlogon.c @@ -1695,8 +1695,9 @@ static WERROR dcesrv_netr_DsRAddressToSitenamesExW(struct dcesrv_call_state *dce if (r->in.addresses[i].size < sizeof(sa_family_t)) { continue; } - /* the first two byte of the buffer are the "sin_family" */ - sin_family = (sa_family_t) *r->in.addresses[i].buffer; + /* The first two byte of the buffer are reserved for the + * "sin_family" but for now only the first one is used. */ + sin_family = r->in.addresses[i].buffer[0]; switch (sin_family) { case AF_INET: -- 2.34.1