commit | 5830d6be9c33e23bb20c339036083e6e4fa6795e | [log] [tgz] |
---|---|---|
author | Eric Sandeen <esandeen@redhat.com> | Wed Aug 30 02:16:55 2006 -0400 |
committer | Theodore Ts'o <tytso@mit.edu> | Wed Aug 30 02:16:55 2006 -0400 |
tree | e896bdb9499e533e0a89d11d7f652ab4bd32ffea | |
parent | 57d7bb7b087d93d67623e260c1380afed1665e24 [diff] |
Detect overflows in loop counters For loops such as: for (i=1; i <= fs->super->s_blocks_count; i++) { <do_stuff> } if i is an int and s_blocks_count is (2^32-1), the condition is never false. Change these loops to: for (i=1; i <= fs->super->s_blocks_count && i > 0; i++) { <do_stuff> } to stop the loop when we overflow i Signed-off-by: Eric Sandeen <esandeen@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>