Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#257 closed defect (fixed)

upstream backup servers index out of bounds

Reported by: Thomas Chen Owned by: Valentin V. Bartenev
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 by Valentin V. Bartenev, 8 years ago

Status: newaccepted

comment:2 by maxim, 8 years ago

Owner: set to Valentin V. Bartenev
Status: acceptedassigned

comment:3 by Valentin V. Bartenev, 8 years ago

In 4992/nginx:

(The changeset message doesn't reference this ticket)

comment:4 by Valentin V. Bartenev, 8 years ago

Resolution: fixed
Status: assignedclosed

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

comment:5 by Maxim Dounin, 8 years ago

In 5056/nginx:

(The changeset message doesn't reference this ticket)

Note: See TracTickets for help on using tickets.