Hey jeff -
On 22 Aug 2001, Jeff Trawick wrote:
> sterling <[EMAIL PROTECTED]> writes:
>
> > It appears that the extension_mappings hash is initialized to null, then
> > only instanciated if there is an AddType call in your conf file. Hence in
> > the type_checker phase it tries to perform a lookup on a null hash.
> >
> > this patch should fix the crash, but IMHO by that point the
> > extension_mappings hash should just be empty, not null (i.e. it should be
> > initialized to apr_hash_make) --
>
> +1 to a patch which initializes apr_hash_make() more sanely so we
> don't have to keep checking
>
>
that would be my pleasure -
sterling.
Index: modules/http/mod_mime.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/modules/http/mod_mime.c,v
retrieving revision 1.56
diff -u -r1.56 mod_mime.c
--- modules/http/mod_mime.c 2001/08/22 20:03:47 1.56
+++ modules/http/mod_mime.c 2001/08/22 20:20:39
@@ -149,7 +149,7 @@
mime_dir_config *new =
(mime_dir_config *) apr_palloc(p, sizeof(mime_dir_config));
- new->extension_mappings = NULL;
+ new->extension_mappings = apr_hash_make(p);
new->charsets_remove = NULL;
new->encodings_remove = NULL;
@@ -827,10 +827,8 @@
ap_str_tolower(ext);
#endif
- if (conf->extension_mappings != NULL) {
- exinfo = (extension_info*)apr_hash_get(conf->extension_mappings,
- ext, APR_HASH_KEY_STRING);
- }
+ exinfo = (extension_info*)apr_hash_get(conf->extension_mappings,
+ ext, APR_HASH_KEY_STRING);
if (exinfo == NULL) {
if ((type = apr_hash_get(mime_type_extensions, ext,