From 8cacc96bf034ac40bb702651c939235fe19df824 Mon Sep 17 00:00:00 2001 From: Timo Teras Date: Wed, 29 Jul 2009 19:06:10 +0300 Subject: tar: don't call digest finalization twice otherwise bad things happens. avoid this be checking end of stream at the beginning of read. --- src/archive.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/archive.c') diff --git a/src/archive.c b/src/archive.c index 4005bf1..68ec287 100644 --- a/src/archive.c +++ b/src/archive.c @@ -90,6 +90,9 @@ static ssize_t tar_entry_read(void *stream, void *ptr, size_t size) if (size > teis->bytes_left) size = teis->bytes_left; + if (size == 0) + return 0; + r = teis->tar_is->read(teis->tar_is, ptr, size); if (r < 0) return r; -- cgit v1.2.3-70-g09d2