httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From minf...@apache.org
Subject svn commit: r645112 - /httpd/httpd/trunk/modules/session/mod_session.c
Date Sat, 05 Apr 2008 15:05:16 GMT
Author: minfrin
Date: Sat Apr  5 08:05:15 2008
New Revision: 645112

URL: http://svn.apache.org/viewvc?rev=645112&view=rev
Log:
Make sure we protect ourselves against the session being NULL, which it will be
if no session is configured.

Modified:
    httpd/httpd/trunk/modules/session/mod_session.c

Modified: httpd/httpd/trunk/modules/session/mod_session.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/session/mod_session.c?rev=645112&r1=645111&r2=645112&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/session/mod_session.c (original)
+++ httpd/httpd/trunk/modules/session/mod_session.c Sat Apr  5 08:05:15 2008
@@ -92,7 +92,9 @@
     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 @@
     if (!z) {
         ap_session_load(r, &z);
     }
-    if (value) {
-        apr_table_set(z->entries, key, value);
-    }
-    else {
-        apr_table_unset(z->entries, key);
+    if (z) {
+        if (value) {
+            apr_table_set(z->entries, key, value);
+        }
+        else {
+            apr_table_unset(z->entries, key);
+        }
+        z->dirty = 1;
     }
-    z->dirty = 1;
 }
 
 /**



Mime
View raw message