summaryrefslogtreecommitdiff
path: root/sapi/apache_hooks/mod_php5.c
diff options
context:
space:
mode:
authorAndi Gutmans <andi@php.net>2004-07-10 07:46:17 (GMT)
committerAndi Gutmans <andi@php.net>2004-07-10 07:46:17 (GMT)
commite5cfb1d05cf10fa694f231dae33ccb03ab8f74c8 (patch)
tree65252174d1cad948046778306ce3ba09d3d78682 /sapi/apache_hooks/mod_php5.c
parent41b639fffebd099699cdf9c3231539d72602ce38 (diff)
downloadphp-e5cfb1d05cf10fa694f231dae33ccb03ab8f74c8.tar.gz
- Better stability during premature shutdown of request startup
Diffstat (limited to 'sapi/apache_hooks/mod_php5.c')
-rw-r--r--sapi/apache_hooks/mod_php5.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/sapi/apache_hooks/mod_php5.c b/sapi/apache_hooks/mod_php5.c
index b15f360..547aed7 100644
--- a/sapi/apache_hooks/mod_php5.c
+++ b/sapi/apache_hooks/mod_php5.c
@@ -564,7 +564,7 @@ static void init_request_info(TSRMLS_D)
request_rec *r = ((request_rec *) SG(server_context));
char *content_length = (char *) table_get(r->subprocess_env, "CONTENT_LENGTH");
const char *authorization=NULL;
- char *tmp;
+ char *tmp, *tmp_user;
SG(request_info).query_string = r->args;
SG(request_info).path_translated = r->filename;
@@ -581,15 +581,16 @@ static void init_request_info(TSRMLS_D)
&& !auth_type(r)
&& !strcasecmp(getword(r->pool, &authorization, ' '), "Basic")) {
tmp = uudecode(r->pool, authorization);
- SG(request_info).auth_user = getword_nulls_nc(r->pool, &tmp, ':');
+ SG(request_info).auth_user = NULL;
+ tmp_user = getword_nulls_nc(r->pool, &tmp, ':');
if (SG(request_info).auth_user) {
- r->connection->user = pstrdup(r->connection->pool, SG(request_info).auth_user);
+ r->connection->user = pstrdup(r->connection->pool, tmp_user);
r->connection->ap_auth_type = "Basic";
- SG(request_info).auth_user = estrdup(SG(request_info).auth_user);
+ SG(request_info).auth_user = estrdup(tmp_user);
}
- SG(request_info).auth_password = tmp;
- if (SG(request_info).auth_password) {
- SG(request_info).auth_password = estrdup(SG(request_info).auth_password);
+ SG(request_info).auth_password = NULL;
+ if (tmp) {
+ SG(request_info).auth_password = estrdup(tmp);
}
} else {
SG(request_info).auth_user = NULL;