CVS commit: src/common/dist/zlib

2017-11-11 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Nov 12 07:55:05 UTC 2017

Modified Files:
src/common/dist/zlib: inflate.c

Log Message:
Restore a local change (in rev1.4) that was lost on zlib 1.12.10 merge.

The rev 1.4 changelog:
> Disable a sanity check output buffer != NULL in _STANDALONE case.
> Some kernels are loaded at address 0x0 by bootloaders and
> output buffer address could be zero in such case.
>
> Fixes "read text" errors on loading install floppy of NetBSD/news68k 4.0,
> reported by KIYOHARA Takashi on port-news68k.

This problem may also affect other m68k ports which use a gzipped install
kernel and kernel text address located at PA 0x0.

Should be pulled up to netbsd-8.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/common/dist/zlib/inflate.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/common/dist/zlib/inflate.c
diff -u src/common/dist/zlib/inflate.c:1.5 src/common/dist/zlib/inflate.c:1.6
--- src/common/dist/zlib/inflate.c:1.5	Tue Jan 10 01:27:41 2017
+++ src/common/dist/zlib/inflate.c	Sun Nov 12 07:55:05 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: inflate.c,v 1.5 2017/01/10 01:27:41 christos Exp $	*/
+/*	$NetBSD: inflate.c,v 1.6 2017/11/12 07:55:05 tsutsui Exp $	*/
 
 /* inflate.c -- zlib decompression
  * Copyright (C) 1995-2016 Mark Adler
@@ -644,9 +644,16 @@ int flush;
 static const unsigned short order[19] = /* permutation of code lengths */
 {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
 
+#if defined(__NetBSD__) && defined(_STANDALONE)
+/* Some kernels are loaded at address 0x0 so strm->next_out could be NULL */
+if (inflateStateCheck(strm) ||
+(strm->next_in == Z_NULL && strm->avail_in != 0))
+return Z_STREAM_ERROR;
+#else
 if (inflateStateCheck(strm) || strm->next_out == Z_NULL ||
 (strm->next_in == Z_NULL && strm->avail_in != 0))
 return Z_STREAM_ERROR;
+#endif
 
 state = (struct inflate_state FAR *)strm->state;
 if (state->mode == TYPE) state->mode = TYPEDO;  /* skip check */



CVS commit: src/common/dist/zlib

2013-11-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Nov  7 17:26:13 UTC 2013

Modified Files:
src/common/dist/zlib: gzio.c

Log Message:
mark variables as used


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/common/dist/zlib/gzio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/common/dist/zlib/gzio.c
diff -u src/common/dist/zlib/gzio.c:1.3 src/common/dist/zlib/gzio.c:1.4
--- src/common/dist/zlib/gzio.c:1.3	Thu May 19 18:23:12 2011
+++ src/common/dist/zlib/gzio.c	Thu Nov  7 12:26:13 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: gzio.c,v 1.3 2011/05/19 22:23:12 tsutsui Exp $	*/
+/*	$NetBSD: gzio.c,v 1.4 2013/11/07 17:26:13 christos Exp $	*/
 
 /* gzio.c -- IO on .gz files
  * Copyright (C) 1995-2005 Jean-loup Gailly.
@@ -157,6 +157,8 @@ local gzFile gz_open (path, mode, fd)
 if (s-mode == 'w') {
 #ifdef NO_GZCOMPRESS
 err = Z_STREAM_ERROR;
+	__USE(level);
+	__USE(strategy);
 #else
 err = deflateInit2((s-stream), level,
Z_DEFLATED, -MAX_WBITS, DEF_MEM_LEVEL, strategy);