Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#257 closed defect (fixed)

upstream backup servers index out of bounds

Reported by: funorpain@… Owned by: vbart
Priority: minor Milestone:
Component: nginx-module Version: 1.2.x
Keywords: Cc:
uname -a:
nginx -V: 1.2.6 1.3.9

Description

--- a/src/http/ngx_http_upstream_round_robin.c  2012-12-11 00:35:32.000000000 +0800
+++ b/src/http/ngx_http_upstream_round_robin.c  2012-12-13 14:41:45.050418212 +0800
@@ -474,7 +474,8 @@
         rrp->peers = peers->next;
         pc->tries = rrp->peers->number;
 
-        n = rrp->peers->number / (8 * sizeof(uintptr_t)) + 1;
+        n = (rrp->peers->number + (8 * sizeof(uintptr_t) - 1))
+                / (8 * sizeof(uintptr_t));
         for (i = 0; i < n; i++) {
              rrp->tried[i] = 0;
         }

Change History (5)

comment:1 Changed 6 years ago by vbart

  • Status changed from new to accepted

comment:2 Changed 6 years ago by maxim

  • Owner set to vbart
  • Status changed from accepted to assigned

comment:3 Changed 6 years ago by vbart

In 4992/nginx:

(The changeset message doesn't reference this ticket)

comment:4 Changed 6 years ago by vbart

  • Resolution set to fixed
  • Status changed from assigned to closed

The fix was committed as part of r4992. Thank you.

comment:5 Changed 6 years ago by mdounin

In 5056/nginx:

(The changeset message doesn't reference this ticket)

Note: See TracTickets for help on using tickets.