From: Cliff Woolley Date: Thu, 21 Mar 2002 16:48:46 +0000 (+0000) Subject: handle_if() and handle_elif() were now correctly checking return codes, X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8a5fe470970487b91e1477b6d0cf1f1de7e38a18;p=thirdparty%2Fapache%2Fhttpd.git handle_if() and handle_elif() were now correctly checking return codes, but send_parsed_content() was ignoring THEIR return codes, resulting in another segfault in a related set of circumstances. In all cases we should consider ret!=0 from any of the handle_foo() functions to mean premature EOF was encountered. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@94097 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/modules/standard/mod_include.c b/src/modules/standard/mod_include.c index 0c6ef083d61..a35115d367a 100644 --- a/src/modules/standard/mod_include.c +++ b/src/modules/standard/mod_include.c @@ -2222,6 +2222,7 @@ static void send_parsed_content(FILE *f, request_rec *r) return; } if (!strcmp(directive, "if")) { + ret = 0; if (!printing) { if_nesting++; } @@ -2230,23 +2231,29 @@ static void send_parsed_content(FILE *f, request_rec *r) &printing); if_nesting = 0; } - continue; + if (!ret) + continue; } else if (!strcmp(directive, "else")) { + ret = 0; if (!if_nesting) { ret = handle_else(f, r, error, &conditional_status, &printing); } - continue; + if (!ret) + continue; } else if (!strcmp(directive, "elif")) { + ret = 0; if (!if_nesting) { ret = handle_elif(f, r, error, &conditional_status, &printing); } - continue; + if (!ret) + continue; } else if (!strcmp(directive, "endif")) { + ret = 0; if (!if_nesting) { ret = handle_endif(f, r, error, &conditional_status, &printing); @@ -2254,12 +2261,13 @@ static void send_parsed_content(FILE *f, request_rec *r) else { if_nesting--; } - continue; + if (!ret) + continue; } - if (!printing) { + else if (!printing) { continue; } - if (!strcmp(directive, "exec")) { + else if (!strcmp(directive, "exec")) { if (noexec) { ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r, "exec used but not allowed in %s",