From: William A. Rowe Jr Date: Mon, 26 Jun 2006 17:41:28 +0000 (+0000) Subject: Make the range test legible; in the process, uncover and close X-Git-Tag: 2.3.0~2309 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5cd174cfcbae4facf3a5b5352286a83b904476ac;p=thirdparty%2Fapache%2Fhttpd.git Make the range test legible; in the process, uncover and close a bounds overflow condition. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@417252 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/scoreboard.c b/server/scoreboard.c index d34ebec083a..223a3f09722 100644 --- a/server/scoreboard.c +++ b/server/scoreboard.c @@ -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];