--- src/main/http_protocol.c	2002/06/17 18:14:12	1.317
+++ src/main/http_protocol.c	2002/06/17 19:38:19	1.318
@@ -1994,6 +1994,12 @@
         }
 
         r->remaining = atol(lenp);
+        if (r->remaining < 0) {
+            ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
+              "Request content-length of %s maps to negative number %ld",
+              lenp, r->remaining);
+            return HTTP_BAD_REQUEST;
+        }
     }
 
     if ((r->read_body == REQUEST_NO_BODY) &&

