Project

General

Profile

Actions

Bug #1882

closed

SEGV in mod_proxy_backend_http.c: wrong int comparison

Added by stepancheg almost 16 years ago. Updated over 15 years ago.

Status:
Fixed
Priority:
Urgent
Category:
mod_proxy_backend_http
Target version:
ASK QUESTIONS IN Forums:

Description

SEGV in mod_proxy_backend_http.c: wrong int comparison: c->mem->used - 1 is (unsigned) -1 when used == 0.

Patch:

--- a/src/mod_proxy_backend_http.c    Mon Jan 26 22:05:16 2009 +0300
+++ b/src/mod_proxy_backend_http.c    Fri Jan 30 18:15:47 2009 +0300
@@ -199,7 +199,7 @@
             data->chunk_parse_state = HTTP_CHUNK_END;
         case HTTP_CHUNK_END:
             /* discard CRLF.*/
-            for(ch = 0; (size_t)(c->offset) < (c->mem->used - 1) && ch != '\n' ;) {
+            for(ch = 0; (ssize_t)(c->offset) < (ssize_t)(c->mem->used - 1) && ch != '\n' ;) {
                 ch = c->mem->ptr[c->offset];
                 c->offset++;
                 in->bytes_out++;

Related issues 1 (0 open1 closed)

Is duplicate of Bug #1154: Segmentation fault in mod_proxy_backend_http.cFixedstbuehlerActions
Actions #1

Updated by stbuehler over 15 years ago

  • Status changed from New to Fixed

Applied in changeset r2443.

Actions

Also available in: Atom