Re: [PATCH] safety limits on refresh_pattern settings.

From: Alex Rousskov <rousskov_at_measurement-factory.com>
Date: Thu, 15 Jul 2010 09:28:14 -0600

On 07/15/2010 02:58 AM, Amos Jeffries wrote:
> Just got reminded about the 32-bit wrap problem in refresh_pattern
> min/max values.
>
> Attached patch limits the values to 1 year (arbitrary based on rumours).
> Checking for 32-bit wrap and setting the max 1 year limit instead of
> cutting them to zero.

Your fix is probably better than nothing, but I would recommend checking
for overflow _before_ we multiply by 60. That way, there is no guess
work involved and no arbitrary limits, with all legitimate values are
accepted.

You may want to wrap the whole minutes-to-seconds logic in a little
function to avoid code duplication.

HTH,

Alex.
Received on Thu Jul 15 2010 - 15:29:17 MDT

This archive was generated by hypermail 2.2.0 : Thu Jul 15 2010 - 12:00:09 MDT