Commit 95239cc5 authored by William A. Rowe Jr's avatar William A. Rowe Jr
Browse files

  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
parent 59d65279
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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];