freebsd-dev/lib/libstand
Maxim Sobolev 056c1a0528 Fix logical bug in the bzip2 reading code, which results in bogus EIO
returned on a perfectly valid bzip2 stream whose decompressed size
is multiple of read-ahead buffer size. Reproduce the problem is easy:
create some power-of-two sized file (truncate -s 1m file will do),
bzip2 it and try to load it as md_image from loader. See how it fails.

The bug doesn't affect gzip code (which most of bzip2-reading code was
copied from) probably due to the fact that libgzip doesn't report
Z_STREAM_END with the last block, but requires extra call to inflate()
to retrieve it and has some extra data in the input stream at that time.
However, apply similar fix to gzipfs.c just in the case the API will
change in the future to do what bzip2 code does.

Add some ifdef'ed code to enable testing bzipfs.c from witin normal
FreeBSD environment as opposed to the restricted loader one, so that
one can use gdb and whatnot.

Sponsored by:	Sippy Software, Inc., http://www.sippysoft.com/
MFC in:		7 days
2007-12-18 01:50:49 +00:00
..
arm
i386
powerpc
sparc64
__main.c
arp.c
assert.c
bcd.c
bootp.c
bootp.h
bootparam.c
bootparam.h
bswap.c
bzipfs.c Fix logical bug in the bzip2 reading code, which results in bogus EIO 2007-12-18 01:50:49 +00:00
cd9660.c
close.c
closeall.c
dev.c
dosfs.c
dosfs.h
environment.c
ether.c
ext2fs.c
fstat.c
getopt.c
gets.c
globals.c
gzipfs.c Fix logical bug in the bzip2 reading code, which results in bogus EIO 2007-12-18 01:50:49 +00:00
if_ether.h
in_cksum.c
inet_ntoa.c
ioctl.c
iodesc.h
libstand.3
lseek.c
Makefile First cut at support for booting a GPT labeled disk via the BIOS bootstrap 2007-10-24 21:33:00 +00:00
net.c
net.h
netif.c
netif.h
nfs.c
nfsv2.h
nullfs.c
open.c
pager.c
printf.c
qdivrem.c
quad.h
random.c
rarp.c
read.c
readdir.c
rpc.c
rpc.h
rpcv2.h
saioctl.h
sbrk.c
splitfs.c
stand.h
stat.c
strcasecmp.c
strdup.c
strerror.c
strtol.c
tftp.c - Given that we tell the compiler that struct ip is packed and 32-bit 2007-10-21 17:03:18 +00:00
tftp.h
twiddle.c
udp.c
ufs.c
write.c
zalloc_defs.h
zalloc_malloc.c
zalloc_mem.h
zalloc_protos.h
zalloc.c