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?p=pintos-anon;a=commitdiff_plain;h=91f094e74195edc22a9b741bba4144834942b40c 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)