Guest-login: always check the servinfo pointer before accesssing it.
authorWilfried Goesgens <dothebart@citadel.org>
Mon, 23 Jul 2012 12:17:30 +0000 (14:17 +0200)
committerWilfried Goesgens <dothebart@citadel.org>
Mon, 23 Jul 2012 12:17:30 +0000 (14:17 +0200)
webcit/auth.c
webcit/iconbar.c
webcit/webcit.c

index 45c78592d34c3a8a89091ee4696bdb871ef28cc8..bce931472879525ed3a0121beb7cd780c6119828 100644 (file)
@@ -499,7 +499,7 @@ void do_logout(void)
        /* Calling output_headers() this way causes the cookies to be un-set */
        output_headers(1, 1, 0, 1, 0, 0);
        do_template("logout");
-       if (WC->serv_info->serv_supports_guest) {
+       if ((WCC->serv_info != NULL) && WCC->serv_info->serv_supports_guest) {
                display_default_landing_page();
                return;
        }
index 422ebbc103ea8b6807cae53c466f81d3d16cf8da..510fbca84c048b23b96f1a68124faf341d255c5b 100644 (file)
@@ -215,11 +215,12 @@ void tmplput_iconbar(StrBuf *Target, WCTemplputParams *TP)
 {
        wcsession *WCC = WC;
        
-        if (   (WCC != NULL)
-               && (    (WCC->logged_in)
-                       || (WCC->serv_info->serv_supports_guest)
-               )
-       ) {
+        if ( (WCC != NULL)     &&
+             ((WCC->logged_in) ||
+             ((WCC->serv_info != NULL) &&
+              (WCC->serv_info->serv_supports_guest))
+                     ) )
+        {
                DoTemplate(HKEY("iconbar"), NULL, &NoCtx);
        }
 }
index 519a18e0dc6a9cc2f3dd7b9202d90a05ec8863e6..9ec539d93159a295ab26ff3fc01ee3a69e15b297 100644 (file)
@@ -741,6 +741,7 @@ void session_loop(void)
        if (WCC->Hdr->HR.Handler != NULL) {
                if (    (!WCC->logged_in)
                        && ((WCC->Hdr->HR.Handler->Flags & ANONYMOUS) == 0)
+                       && (WCC->serv_info != NULL)
                        && (WCC->serv_info->serv_supports_guest == 0)
                ) {
                        display_login();