diff options
author | dfr <dfr@FreeBSD.org> | 2004-05-23 10:06:33 +0000 |
---|---|---|
committer | dfr <dfr@FreeBSD.org> | 2004-05-23 10:06:33 +0000 |
commit | 7e8e4a7736aeaddb622871b92f843f7b426bcb88 (patch) | |
tree | 80e65f723b235d011357477da18730b7a3fed01b /usr.sbin/fwcontrol | |
parent | 6c819c3288ab49f593a3b4d66a8c3a146fa577b2 (diff) | |
download | FreeBSD-src-7e8e4a7736aeaddb622871b92f843f7b426bcb88.zip FreeBSD-src-7e8e4a7736aeaddb622871b92f843f7b426bcb88.tar.gz |
Don't crash if the CROM is all zeros.
Diffstat (limited to 'usr.sbin/fwcontrol')
-rw-r--r-- | usr.sbin/fwcontrol/fwcontrol.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/usr.sbin/fwcontrol/fwcontrol.c b/usr.sbin/fwcontrol/fwcontrol.c index a7465f5..99c13a6 100644 --- a/usr.sbin/fwcontrol/fwcontrol.c +++ b/usr.sbin/fwcontrol/fwcontrol.c @@ -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); |