Bug#238051: apache2-common: mod_disk_cache causes segfaults for apt queries
Package: apache2-common
Version: 2.0.48-7
Severity: normal
Tags: patch, upstream
I configured apache2 as a caching proxy server. It works most of the
time, but usually fails for requests generated by apt. I found this
report in bugzilla:
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27370
and tried the patch attached. It seems to work here. Any chance this
could be added for the next build ?
-- System Information:
Debian Release: testing/unstable
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.4
Locale: LANG=C, LC_CTYPE=C
Versions of packages apache2-common depends on:
ii debconf 1.4.16 Debian configuration management sy
ii debianutils 2.7.2 Miscellaneous utilities specific t
ii libapr0 2.0.48-7 The Apache Portable Runtime
ii libc6 2.3.2.ds1-11 GNU C Library: Shared libraries an
ii libdb4.2 4.2.52-14 Berkeley v4.2 Database Libraries [
ii libexpat1 1.95.6-8 XML parsing C library - runtime li
ii libldap2 2.1.26-1 OpenLDAP libraries
ii libssl0.9.7 0.9.7c-5 SSL shared libraries
ii mime-support 3.26-1 MIME files 'mime.types' & 'mailcap
ii net-tools 1.60-9 The NET-3 networking toolkit
ii openssl 0.9.7c-5 Secure Socket Layer (SSL) binary a
ii ssl-cert 1.0-7 Simple debconf wrapper for openssl
ii zlib1g 1:1.2.1-5 compression library - runtime
-- no debconf information
--- build-tree.orig/apache2/modules/experimental/cache_storage.c 2004-03-02 15:19:08.000000000 +0100
+++ build-tree/apache2/modules/modules/experimental/cache_storage.c 2004-03-02 15:24:39.000000000 +0100
@@ -180,7 +180,7 @@
return rv;
}
/* go through the cache types till we get a match */
- h = cache->handle = apr_palloc(r->pool, sizeof(cache_handle_t));
+ h = cache->handle = apr_pcalloc(r->pool, sizeof(cache_handle_t));
while (next) {
type = ap_cache_tokstr(r->pool, next, &next);
@@ -283,7 +283,10 @@
return rv;
}
- r->filename = apr_pstrdup(r->pool, info->filename );
+ /* mod_disk_cache does not set info->filename */
+ if (info->filename) {
+ r->filename = apr_pstrdup(r->pool, info->filename );
+ }
return APR_SUCCESS;
}
Reply to: