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) {
ap_session_load(r, &z);
}
*value = apr_table_get(z->entries, key);
if (z) {
*value = apr_table_get(z->entries, key);
}
}
/**
@@ -113,13 +115,15 @@ AP_DECLARE(void) ap_session_set(request_rec * r, session_rec * z,
if (!z) {
ap_session_load(r, &z);
}
if (value) {
apr_table_set(z->entries, key, value);
if (z) {
if (value) {
apr_table_set(z->entries, key, value);
}
else {
apr_table_unset(z->entries, key);
}
z->dirty = 1;
}
else {
apr_table_unset(z->entries, key);
}
z->dirty = 1;
}
/**