From 495e6085d74760888595817663ee47e219384596 Mon Sep 17 00:00:00 2001 From: "Paul J. Reder" Date: Sat, 22 Nov 2003 02:11:00 +0000 Subject: [PATCH] A better solution than my previous commit as pointed out by Andre Malo. mod_expires: Initialize ExpiresDefault to NULL instead of "" to avoid reporting an Internal Server error if it is used without having been set in the httpd.conf file. PR: 23748, 24459 Submitted: Andre Malo, Liam Quinn Reviewed: Andre Malo, Paul J. Reder git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101846 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 7 ++++--- modules/metadata/mod_expires.c | 7 +++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index 6a5d8071b9..fbbdc5e42f 100644 --- a/CHANGES +++ b/CHANGES @@ -2,9 +2,10 @@ Changes with Apache 2.1.0-dev [Remove entries to the current 2.0 section below, when backported] - *) mod_expires: Don't report an Internal Server error if ExpiresDefault - is used and has not been set in the httpd.conf file. PR: 23748, 24459 - [Liam Quinn ] + *) mod_expires: Initialize ExpiresDefault to NULL instead of "" to + avoid reporting an Internal Server error if it is used without + having been set in the httpd.conf file. PR: 23748, 24459 + [Andre Malo, Liam Quinn ] *) mod_logio: Account for some bytes handed to the network layer prior to dropped connections. [Jeff Trawick] diff --git a/modules/metadata/mod_expires.c b/modules/metadata/mod_expires.c index d7445ad634..44a63d56d7 100644 --- a/modules/metadata/mod_expires.c +++ b/modules/metadata/mod_expires.c @@ -229,7 +229,7 @@ static void *create_dir_expires_config(apr_pool_t *p, char *dummy) (expires_dir_config *) apr_pcalloc(p, sizeof(expires_dir_config)); new->active = ACTIVE_DONTCARE; new->wildcards = 0; - new->expiresdefault = ""; + new->expiresdefault = NULL; new->expiresbytype = apr_table_make(p, 4); return (void *) new; } @@ -412,7 +412,7 @@ static void *merge_expires_dir_configs(apr_pool_t *p, void *basev, void *addv) new->active = add->active; } - if (add->expiresdefault[0] != '\0') { + if (add->expiresdefault != NULL) { new->expiresdefault = add->expiresdefault; } else { @@ -548,8 +548,7 @@ static apr_status_t expires_filter(ap_filter_t *f, expiry = conf->expiresdefault; } } - /* != '\0' covers the case where ExpiresDefault is not user defined. */ - if (expiry != NULL && expiry[0] != '\0') { + if (expiry != NULL) { set_expiration_fields(r, expiry, t); } } -- 2.40.0