Re: Possible memory fault in pinger

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Fri, 16 Apr 2004 11:23:02 +0200 (CEST)

On Fri, 16 Apr 2004, Evgeny Kotsuba wrote:

> Hi,
> Squid 2.5 and Squid 3
> file pinger.c/pinger.cc, function pingerSendEcho()
> 1)
> I have
> //MAX_PKT_SZ=294, sizeof(pkt)=294, sizeof(struct
> icmhdr)=28,sizeof(icmpEchoData)=268,
> //28+268=296 > 294!

Eh? The size of MAX_PKT_SZ is dependent on MAX_PAYLOAD to make sure the
packet is sufficiently large.

If you manually set MAX_PKT_SZ to something else then you must change all
code building the packet. The code is not designed with this in mind.

> 2) Just look at Squid3 and a number versions of v2.xx
>
> in 2.5 we have
> icmp_pktsize += sizeof(struct timeval) + sizeof(char);
> In 3.0 and 2.4
> icmp_pktsize += sizeof(icmpEchoData) - MAX_PAYLOAD;

My 3.0 tree reads

    icmp_pktsize += sizeof(struct timeval) + sizeof(char);

Are you perhaps looking at some old code?

Make sure your Squid-3 tree is up to date. Chances are high you are
looking at an old bug which is already fixed.

Looking at Squid-2.4 is not relevant. This has not been maintained for
many years and is known to have very many bugs.

Regards
Henrik
Received on Fri Apr 16 2004 - 03:23:05 MDT

This archive was generated by hypermail pre-2.1.9 : Thu Apr 29 2004 - 12:00:03 MDT