httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Havard" <>
Subject [PATCH] PR#2395 coredump if proxy-cache is disabled
Date Wed, 22 Jul 1998 14:53:48 GMT
I've found the location that triggers the core dump described in 
ap_proxy_cache_update() (in proxy_cache.c). It has determined that the
object isn't cacheable and decideds to unlink the related cache file. The
problem seems to be that as caching is disabled (no CacheRoot) there is no
file so the file name is NULL. The core dump comes from passing NULL to 

The following patch stops the core dumps but I get the feeling that it 
shouldn't have even reached the function ap_proxy_cache_update() if no caching
is going on. I don't know the proxy module well enough to determine what needs
to be fixed though, or why it only seems to happen in OS/2. Does unix accept
unlink(NULL) as a no-op?

Index: proxy_cache.c
RCS file: /cvs/apache-1.3/src/modules/proxy/proxy_cache.c,v
retrieving revision 1.46
diff -u -r1.46 proxy_cache.c
--- proxy_cache.c	1998/07/09 19:45:56	1.46
+++ proxy_cache.c	1998/07/22 14:49:36
@@ -846,7 +846,8 @@
 	    c->fp = NULL;
 /* delete the previously cached file */
-	unlink(c->filename);
+        if (c->filename)
+            unlink(c->filename);
 	return DECLINED;	/* send data to client but not cache */

 |  Brian Havard                 |  "He is not the messiah!                   |
 |  |  He's a very naughty boy!" - Life of Brian |

View raw message