1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-08 15:02:10 +03:00

Make sure we protect ourselves against the session being NULL, which it will be

if no session is configured.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@645112 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Graham Leggett
2008-04-05 15:05:15 +00:00
parent 1627d916f9
commit f10397f26c

View File

@@ -92,7 +92,9 @@ AP_DECLARE(void) ap_session_get(request_rec * r, session_rec * z, const char *ke
if (!z) { if (!z) {
ap_session_load(r, &z); ap_session_load(r, &z);
} }
if (z) {
*value = apr_table_get(z->entries, key); *value = apr_table_get(z->entries, key);
}
} }
/** /**
@@ -113,6 +115,7 @@ AP_DECLARE(void) ap_session_set(request_rec * r, session_rec * z,
if (!z) { if (!z) {
ap_session_load(r, &z); ap_session_load(r, &z);
} }
if (z) {
if (value) { if (value) {
apr_table_set(z->entries, key, value); apr_table_set(z->entries, key, value);
} }
@@ -120,6 +123,7 @@ AP_DECLARE(void) ap_session_set(request_rec * r, session_rec * z,
apr_table_unset(z->entries, key); apr_table_unset(z->entries, key);
} }
z->dirty = 1; z->dirty = 1;
}
} }
/** /**