From: Wilfried Goesgens Date: Mon, 23 Jul 2012 12:17:30 +0000 (+0200) Subject: Guest-login: always check the servinfo pointer before accesssing it. X-Git-Tag: v8.16~27 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=376dd32e8b9c84dbd31993e62fa917b038583537 Guest-login: always check the servinfo pointer before accesssing it. --- diff --git a/webcit/auth.c b/webcit/auth.c index 45c78592d..bce931472 100644 --- a/webcit/auth.c +++ b/webcit/auth.c @@ -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; } diff --git a/webcit/iconbar.c b/webcit/iconbar.c index 422ebbc10..510fbca84 100644 --- a/webcit/iconbar.c +++ b/webcit/iconbar.c @@ -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); } } diff --git a/webcit/webcit.c b/webcit/webcit.c index 519a18e0d..9ec539d93 100644 --- a/webcit/webcit.c +++ b/webcit/webcit.c @@ -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();