X-Git-Url: https://git.saurik.com/apple/network_cmds.git/blobdiff_plain/ffda1f4a07bc29b162ac42e2babde7cf0d4efa38..8d01c3442b975fe0fe2e3fb87b8c8b61d637f8eb:/alias/alias_irc.c?ds=sidebyside diff --git a/alias/alias_irc.c b/alias/alias_irc.c index d228b96..4ecddb9 100644 --- a/alias/alias_irc.c +++ b/alias/alias_irc.c @@ -3,20 +3,19 @@ * * @APPLE_LICENSE_HEADER_START@ * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this - * file. + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. * * @APPLE_LICENSE_HEADER_END@ */ @@ -126,7 +125,7 @@ lFOUND_CTCP: char newpacket[65536]; /* Estimate of maximum packet size :) */ int copyat = i; /* Same */ int iCopy = 0; /* How much data have we written to copy-back string? */ - unsigned long org_addr; /* Original IP address */ + in_addr_t org_addr; /* Original IP address */ unsigned short org_port; /* Original source port address */ lCTCP_START: if( i >= dlen || iCopy >= sizeof(newpacket) ) @@ -210,7 +209,7 @@ lFOUND_CTCP: /* Fetch IP address */ org_addr = 0; while(i ULONG_MAX/10UL ) { /* Terminate on overflow */ + if( org_addr > 0xFFFFFFFF/10UL ) { /* Terminate on overflow */ DBprintf(("DCC Address overflow (org_addr == 0x%08lx, next char %c\n", org_addr, sptr[i])); goto lBAD_CTCP; } @@ -284,7 +283,7 @@ lFOUND_CTCP: alias_address = GetAliasAddress(link); iCopy += snprintf(&newpacket[iCopy], sizeof(newpacket)-iCopy, - "%lu ", (u_long)htonl(alias_address.s_addr)); + "%u ", (in_addr_t)htonl(alias_address.s_addr)); if( iCopy >= sizeof(newpacket) ) { /* Truncated/fit exactly - bad news */ DBprintf(("DCC constructed packet overflow.\n")); goto lBAD_CTCP;