Don't crash if the CROM is all zeros.
This commit is contained in:
parent
9a6a20eeff
commit
3d7b1b4143
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=129604
@ -326,6 +326,10 @@ show_crom(u_int32_t *crom_buf)
|
||||
|
||||
crom_init_context(&cc, crom_buf);
|
||||
dir = cc.stack[0].dir;
|
||||
if (!dir) {
|
||||
printf("no root directory - giving up\n");
|
||||
return;
|
||||
}
|
||||
printf("root_directory: len=0x%04x(%d) crc=0x%04x",
|
||||
dir->crc_len, dir->crc_len, dir->crc);
|
||||
crc = crom_crc((u_int32_t *)&dir->entry[0], dir->crc_len);
|
||||
|
Loading…
Reference in New Issue
Block a user