[Privoxy-devel] how costly is --enable-strptime-sanity-checks ?

Fabian Keil fk at fabiankeil.de
Mon May 2 15:48:06 UTC 2016


Ian Silvester <iansilvester at fastmail.fm> wrote:

> > The sanity check only detects inconsistencies between strptime()
> > and strftime() as this was sufficient to detect the FreeBSD libc bug.
> > If both fail consistently the check may not catch it.
> > 
> > In your example above strftime() seems to reject the date completely,
> > but on other platforms it could silently produce incorrect results.  
> 
> So to be clear am I looking for log entries with evidently wrong
> datestamps? 

You can enable "debug 8" and check the log messages for the
If-Modified-Since-related tests from Privoxy-Regression-Test.

Example:

2016-05-02 17:28:54.760 801ab9700 Header: Randomizing: If-Modified-Since: Thu, 1 Jan 1970 00:00:00 GMT (random range: -60 minutes)
2016-05-02 17:28:54.760 801ab9700 Header: Randomized:  If-Modified-Since: Wed, 31 Dec 1969 23:01:50 GMT (subtracted 0 hours 58 minutes 10 seconds)
[...]
2016-05-02 17:28:55.078 801b4d300 Header: Randomizing: If-Modified-Since: Mon, 01-Jan-2525 00:00:00 GMT (random range: -60 minutes)
2016-05-02 17:28:55.079 801b4d300 Header: Randomized:  If-Modified-Since: Sun, 31 Dec 2524 23:44:08 GMT (subtracted 0 hours 15 minutes 52 seconds)

On a system with a 32-bit size_t it's likely that the randomized
date will be more than 60 minutes apart from the original one.

If it works as expected before 1970 and after 2038, other dates
are likely to be handled correctly as well.

Fabian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <https://lists.privoxy.org/pipermail/privoxy-devel/attachments/20160502/bc126b1f/attachment.bin>


More information about the Privoxy-devel mailing list