From 6878964fa59b4447bc13f7433baf92888247f20a Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Mon, 23 Jul 2012 14:17:30 +0200 Subject: [PATCH] Guest-login: always check the servinfo pointer before accesssing it. --- webcit/auth.c | 2 +- webcit/iconbar.c | 11 ++++++----- webcit/webcit.c | 1 + 3 files changed, 8 insertions(+), 6 deletions(-) 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(); -- 2.30.2