From fc3f1d5cd7d0c585706ce2267d3d8a957534063c Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Sun, 28 Sep 2014 09:38:44 -0700 Subject: [PATCH] Fix crash reading malformed config files If ConfigParser::QuotedOrToEol() happend to return NULL. Which may happen if there is no token before end of current file the auth module config parser would crash. Detected by Coverity Scan. Issue 1222662. --- src/auth/Config.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/auth/Config.cc b/src/auth/Config.cc index fb2ef3f919..8798180907 100644 --- a/src/auth/Config.cc +++ b/src/auth/Config.cc @@ -86,7 +86,7 @@ Auth::Config::parse(Auth::Config * scheme, int n_configured, char *param_str) char *token = ConfigParser::NextQuotedOrToEol(); - while (*token && xisspace(*token)) + while (token && *token && xisspace(*token)) ++token; if (!token || !*token) { -- 2.47.2