author | Linus Torvalds <torvalds@linux-foundation.org> | |
Tue, 20 Mar 2007 05:49:53 +0000 (22:49 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 20 Mar 2007 06:13:17 +0000 (23:13 -0700) | ||
commit | 456cdf6edbf0c14b75fd9048708e9abea43e6aa1 | |
tree | a6ff1b062b8c3a6c20b0d03bfa938c6a5ed070b4 | tree | snapshot |
parent | 3e993bb657daad31d8a7b1ef0a6a9f73bdd5f950 | commit | diff |
Fix loose object uncompression check.
The thing is, if the output buffer is empty, we should *still* actually
use the zlib routines to *unpack* that empty output buffer.
But we had a test that said "only unpack if we still expect more output".
So we wouldn't use up all the zlib stream, because we felt that we didn't
need it, because we already had all the bytes we wanted. And it was
"true": we did have all the output data. We just needed to also eat all
the input data!
We've had this bug before - thinking that we don't need to inflate()
anything because we already had it all..
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
The thing is, if the output buffer is empty, we should *still* actually
use the zlib routines to *unpack* that empty output buffer.
But we had a test that said "only unpack if we still expect more output".
So we wouldn't use up all the zlib stream, because we felt that we didn't
need it, because we already had all the bytes we wanted. And it was
"true": we did have all the output data. We just needed to also eat all
the input data!
We've had this bug before - thinking that we don't need to inflate()
anything because we already had it all..
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
sha1_file.c | diff | blob | history |