diff options
author | 2020-04-18 17:11:37 +0000 | |
---|---|---|
committer | 2020-04-18 17:11:37 +0000 | |
commit | db3259920abe5307a419fb57511aae4225381249 (patch) | |
tree | f67425acfcbb5b6171c85d82f758b842ba8416db | |
parent | Rewrite the flag-parsing code to be getopt-like. Tight formations like (diff) | |
download | wireguard-openbsd-db3259920abe5307a419fb57511aae4225381249.tar.xz wireguard-openbsd-db3259920abe5307a419fb57511aae4225381249.zip |
When opening a completely empty file with gzopen(3), treat it as an
uncompressed file, such that the first gzread(3) results in Z_STREAM_END
rather than in the misleading Z_BUF_ERROR.
I checked that none of the many copies of libz in our tree
suffer from the same bug, after deraadt@ asked.
Bugfix patch from Olivier Taibi <oli at olitb dot net> on bugs@.
OK millert@.
-rw-r--r-- | lib/libz/gzio.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libz/gzio.c b/lib/libz/gzio.c index 9df9e423f41..ab77ad9be19 100644 --- a/lib/libz/gzio.c +++ b/lib/libz/gzio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gzio.c,v 1.14 2005/07/20 15:56:41 millert Exp $ */ +/* $OpenBSD: gzio.c,v 1.15 2020/04/18 17:11:37 schwarze Exp $ */ /* gzio.c -- IO on .gz files * Copyright (C) 1995-2005 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h @@ -307,7 +307,7 @@ local void check_header(s) s->stream.avail_in += len; s->stream.next_in = s->inbuf; if (s->stream.avail_in < 2) { - s->transparent = s->stream.avail_in; + s->transparent = 1; return; } } |