From 936ae790575e62ada610d6f5a2b33252c908cc63 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Tue, 19 May 2009 17:52:03 +0000 Subject: [PATCH] Fix a recently added logic error that could result in keep_alive_timeout being read uninitialized. Detected by clang. Pointy hat to me. --- parsers.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/parsers.c b/parsers.c index 48845d78..7896117b 100644 --- a/parsers.c +++ b/parsers.c @@ -1,4 +1,4 @@ -const char parsers_rcs[] = "$Id: parsers.c,v 1.158 2009/05/19 17:27:05 fabiankeil Exp $"; +const char parsers_rcs[] = "$Id: parsers.c,v 1.159 2009/05/19 17:48:58 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/parsers.c,v $ @@ -1617,8 +1617,8 @@ static jb_err server_keep_alive(struct client_state *csp, char **header) unsigned int keep_alive_timeout; const char *timeout_position = strstr(*header, "timeout="); - if ((NULL != timeout_position) - && (1 != sscanf(timeout_position, "timeout=%u", &keep_alive_timeout))) + if ((NULL == timeout_position) + || (1 != sscanf(timeout_position, "timeout=%u", &keep_alive_timeout))) { log_error(LOG_LEVEL_ERROR, "Couldn't parse: %s", *header); } -- 2.39.2