freebsd-skq/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 Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
powerpc
sparc64 Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
__main.c
arp.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
assert.c
bcd.c
bootp.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
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 Implement the full range of ISO9660 number conversion routines in iso.h. 2005-10-18 13:35:08 +00:00
close.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
closeall.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
dev.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
dosfs.c
dosfs.h
environment.c Cast away const qualifier to squash GCC warning. 2007-04-04 03:29:02 +00:00
ether.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
ext2fs.c
fstat.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
getopt.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
gets.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
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 Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
in_cksum.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
inet_ntoa.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
ioctl.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
iodesc.h Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
libstand.3 Fix prototypes. 2005-11-24 11:14:06 +00:00
lseek.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
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 Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
net.h Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
netif.c
netif.h
nfs.c
nfsv2.h Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
nullfs.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
open.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
pager.c
printf.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
qdivrem.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
quad.h Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
random.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
rarp.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
read.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
readdir.c
rpc.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
rpc.h Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
rpcv2.h Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
saioctl.h Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
sbrk.c
splitfs.c Remove unused variable. Shorten the path to WARNS=6 compliance. 2005-05-20 12:55:38 +00:00
stand.h Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
stat.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
strcasecmp.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
strdup.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
strerror.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
strtol.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
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 Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
udp.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
ufs.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
write.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
zalloc_defs.h Just use uintptr_t and intptr_t rather than requiring each arch to provide 2005-05-31 20:01:18 +00:00
zalloc_malloc.c
zalloc_mem.h
zalloc_protos.h
zalloc.c