Re: [Squid-cvs] cygwin squid/src useragent.c,,

From: Guido Serassio <>
Date: Sun, 15 Jul 2001 18:08:15 +0200


Il 00.04 12/07/2001 Duane Wessels ha scritto:

> > >And I think the check should be in logfileClose, not in each function
> > >using it..
> >
> > This is a better solution, in logfileClose seems to be no protection
> from this.
>It should be in each function using it. That is the way it is
>currently done.
>All of the logfile functions assume that their arguments are valid.
>It is up to the caller to check for NULL pointers and such.


In useragent.c we have a potential problem:

If Squid is compiled with useragent log enabled, but this is not configured
in squid.conf,
useragentlog is NULL, so we have a segmentation fault at Squid shutdown time.

>I want logfileClose(NULL) to be an error, just as fclose(NULL)
>is an error.

So, if this must be true, the only logical solution is to add the following
check to the HEAD and 2.4S1 code:

Index: useragent.c
RCS file: /cvsroot/squid/squid/src/useragent.c,v
retrieving revision
retrieving revision
diff -w -u -r1.3.28.2 -r1.3.28.3
--- useragent.c 2001/05/21 21:10:28
+++ useragent.c 2001/07/10 20:25:43
@@ -87,6 +87,7 @@
+ if (NULL != useragentlog)
      useragentlog = NULL;


Serassio Guido
Via Albenga, 11/4 10134 - Torino - ITALY
Tel. : +39.011.610749
Received on Sun Jul 15 2001 - 10:08:27 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:14:07 MST