]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Make the range test legible; in the process, uncover and close
authorWilliam A. Rowe Jr <wrowe@apache.org>
Mon, 26 Jun 2006 17:41:28 +0000 (17:41 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Mon, 26 Jun 2006 17:41:28 +0000 (17:41 +0000)
  a bounds overflow condition.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@417252 13f79535-47bb-0310-9956-ffa450edef68

server/scoreboard.c

index d34ebec083ae9d8b072e139ef8b329980fef5a68..223a3f09722c0a9833f5543376171c935cb14f5c 100644 (file)
@@ -468,8 +468,8 @@ void ap_time_process_request(ap_sb_handle_t *sbh, int status)
 
 AP_DECLARE(worker_score *) ap_get_scoreboard_worker(int x, int y)
 {
-    if (((x < 0) || (server_limit < x)) ||
-        ((y < 0) || (thread_limit < y))) {
+    if (((x < 0) || (x >= server_limit)) ||
+        ((y < 0) || (y >= thread_limit))) {
         return(NULL); /* Out of range */
     }
     return &ap_scoreboard_image->servers[x][y];
@@ -477,7 +477,7 @@ AP_DECLARE(worker_score *) ap_get_scoreboard_worker(int x, int y)
 
 AP_DECLARE(process_score *) ap_get_scoreboard_process(int x)
 {
-    if ((x < 0) || (server_limit < x)) {
+    if ((x < 0) || (x >= server_limit)) {
         return(NULL); /* Out of range */
     }
     return &ap_scoreboard_image->parent[x];