diff options
author | Frans Kaashoek <[email protected]> | 2015-04-10 07:15:06 -0400 |
---|---|---|
committer | Frans Kaashoek <[email protected]> | 2015-04-10 07:15:06 -0400 |
commit | 895af77fe6ff7c73f198e852a40976ed102a49e4 (patch) | |
tree | c951d87e397c48268fd9daf0925e2907a803a177 /ide.c | |
parent | c24ac5d76353d04955cc348f1cb5b95743c42b38 (diff) | |
download | xv6-labs-895af77fe6ff7c73f198e852a40976ed102a49e4.tar.gz xv6-labs-895af77fe6ff7c73f198e852a40976ed102a49e4.tar.bz2 xv6-labs-895af77fe6ff7c73f198e852a40976ed102a49e4.zip |
check blockno passed to idestart
Diffstat (limited to 'ide.c')
-rw-r--r-- | ide.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -48,7 +48,7 @@ void ideinit(void) { int i; - + initlock(&idelock, "ide"); picenable(IRQ_IDE); ioapicenable(IRQ_IDE, ncpu - 1); @@ -73,6 +73,8 @@ idestart(struct buf *b) { if(b == 0) panic("idestart"); + if(b->blockno >= FSSIZE) + panic("incorrect blockno"); int sector_per_block = BSIZE/SECTOR_SIZE; int sector = b->blockno * sector_per_block; |