Re: [PATCH] IpAdress truncates printed port that exceeds 9999

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Sun, 02 May 2010 13:49:46 +1200

Alex Rousskov wrote:
> Fixed IpAddress port printing for ports higher than 9999:
> snprintf includes zero-terminator in its size limit, so 7
> rather than 6 bytes are needed to snprintf a colon followed
> by 5 port digits.
>
> Whether the bug has any runtime effects in the current code,
> I do not know, but I did waste a few hours following
> misleading debugging output.
>
> Alex.
>

+1. Please commit with tweak:
  MAX_IPSTRLEN definition needs +1 as well to prevent this introducing a
buffer overflow.

Amos

-- 
Please be using
   Current Stable Squid 2.7.STABLE9 or 3.1.1
Received on Sun May 02 2010 - 01:49:54 MDT

This archive was generated by hypermail 2.2.0 : Mon May 24 2010 - 12:00:11 MDT