From: serassio <> Date: Fri, 21 Jul 2006 21:24:58 +0000 (+0000) Subject: Windows arp ACL fixes by Gennadiy Tsarenkov: X-Git-Tag: SQUID_3_0_PRE5~215 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=922a84556a1826baf230203a85f1dd025f48a0e0;p=thirdparty%2Fsquid.git Windows arp ACL fixes by Gennadiy Tsarenkov: - Wrong usage of dwPhysAddrLen - Initialize to 0 the arpReq structure --- diff --git a/src/ACLARP.cc b/src/ACLARP.cc index 1e709b8c06..937776f75f 100644 --- a/src/ACLARP.cc +++ b/src/ACLARP.cc @@ -1,5 +1,5 @@ /* - * $Id: ACLARP.cc,v 1.20 2006/04/23 14:14:18 serassio Exp $ + * $Id: ACLARP.cc,v 1.21 2006/07/21 15:24:58 serassio Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -557,6 +557,8 @@ aclMatchArp(SplayNode **dataptr, struct IN_ADDR c) struct arpreq arpReq; + memset(&arpReq, '\0', sizeof(arpReq)); + /* Get size of Windows ARP table */ if (GetIpNetTable(NetTable, &ipNetTableLen, FALSE) != ERROR_INSUFFICIENT_BUFFER) { debug(28, 0) ("Can't estimate ARP table size!\n"); @@ -580,7 +582,7 @@ aclMatchArp(SplayNode **dataptr, struct IN_ADDR c) for (i = 0 ; i < NetTable->dwNumEntries ; i++) { if ((c.s_addr == NetTable->table[i].dwAddr) && (NetTable->table[i].dwType > 2)) { arpReq.arp_ha.sa_family = AF_UNSPEC; - memcpy(arpReq.arp_ha.sa_data, NetTable->table[i].bPhysAddr, NetTable[i].table->dwPhysAddrLen); + memcpy(arpReq.arp_ha.sa_data, NetTable->table[i].bPhysAddr, NetTable->table[i].dwPhysAddrLen); } }