]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
handle_if() and handle_elif() were now correctly checking return codes,
authorCliff Woolley <jwoolley@apache.org>
Thu, 21 Mar 2002 16:48:46 +0000 (16:48 +0000)
committerCliff Woolley <jwoolley@apache.org>
Thu, 21 Mar 2002 16:48:46 +0000 (16:48 +0000)
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

src/modules/standard/mod_include.c

index 0c6ef083d614371f9e6b7be8029aea7213b9fd39..a35115d367a91e836454389af9f8c42564b762c8 100644 (file)
@@ -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",