Range-check values building mbdev in boot monitor
This commit is contained in:
parent
5cddf6dce8
commit
9df7ce09aa
1 changed files with 3 additions and 3 deletions
|
@ -1228,9 +1228,9 @@ dev_t name2dev(char *name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mbdev = (u32_t)tmpdev.device << 24
|
mbdev = (u32_t)(tmpdev.device & 0xff) << 24
|
||||||
| (u32_t)tmpdev.primary << 16
|
| (u32_t)(tmpdev.primary & 0xff) << 16
|
||||||
| (u32_t)tmpdev.secondary << 8
|
| (u32_t)(tmpdev.secondary & 0xff) << 8 /* (-1 & 0xff) is 0xff */
|
||||||
| 0xff;
|
| 0xff;
|
||||||
|
|
||||||
/* Look the name up on the boot device for the UNIX device number. */
|
/* Look the name up on the boot device for the UNIX device number. */
|
||||||
|
|
Loading…
Reference in a new issue