Don't use array access to compute addresses that are definitely beyond
the static array boundaries.
This commit is contained in:
parent
7ba5ed4f95
commit
90aa08ed31
|
@ -2635,7 +2635,7 @@ mDNSexport const mDNSu8 *GetLargeResourceRecord(mDNS *const m, const DNSMessage
|
|||
case kDNSType_OPT: {
|
||||
rdataOPT *opt = rr->resrec.rdata->u.opt;
|
||||
rr->resrec.rdlength = 0;
|
||||
while (ptr < end && (mDNSu8 *)(opt+1) < &rr->resrec.rdata->u.data[MaximumRDSize])
|
||||
while (ptr < end && (mDNSu8 *)(opt+1) < rr->resrec.rdata->u.data + MaximumRDSize)
|
||||
{
|
||||
if (ptr + 4 > end) { LogMsg("GetLargeResourceRecord: OPT RDATA ptr + 4 > end"); return(mDNSNULL); }
|
||||
opt->opt = getVal16(&ptr);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ping.c,v 1.93 2011/03/11 09:59:56 pooka Exp $ */
|
||||
/* $NetBSD: ping.c,v 1.94 2011/08/09 12:55:19 joerg Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989, 1993
|
||||
|
@ -58,7 +58,7 @@
|
|||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: ping.c,v 1.93 2011/03/11 09:59:56 pooka Exp $");
|
||||
__RCSID("$NetBSD: ping.c,v 1.94 2011/08/09 12:55:19 joerg Exp $");
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
@ -1069,8 +1069,8 @@ pr_pack(u_char *buf,
|
|||
/* check the data */
|
||||
if (datalen > (int)PHDR_LEN
|
||||
&& !(pingflags & F_PING_RANDOM)
|
||||
&& memcmp(&icp->icmp_data[PHDR_LEN],
|
||||
&opack_icmp.icmp_data[PHDR_LEN],
|
||||
&& memcmp(icp->icmp_data + PHDR_LEN,
|
||||
opack_icmp.icmp_data + PHDR_LEN,
|
||||
datalen-PHDR_LEN)) {
|
||||
for (i=PHDR_LEN; i<datalen; i++) {
|
||||
if (icp->icmp_data[i] !=
|
||||
|
|
Loading…
Reference in New Issue