From: Joseph Huang Date: Wed, 5 May 2010 16:23:55 +0000 (-0700) Subject: block: Avoid accessing past the end of the block_by_role array. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=399802a0f78428b60ee0e451fa53e40f3676595a;p=pintos-anon block: Avoid accessing past the end of the block_by_role array. --- diff --git a/src/devices/block.c b/src/devices/block.c index 452c433..a3acec1 100644 --- a/src/devices/block.c +++ b/src/devices/block.c @@ -166,7 +166,7 @@ block_print_stats (void) { int i; - for (i = 0; i < BLOCK_CNT; i++) + for (i = 0; i < BLOCK_ROLE_CNT; i++) { struct block *block = block_by_role[i]; if (block != NULL)