Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-8]: src/common/dist/zlib Pull up following revision(s) (requested...



details:   https://anonhg.NetBSD.org/src/rev/da7600de25a0
branches:  netbsd-8
changeset: 851152:da7600de25a0
user:      martin <martin%NetBSD.org@localhost>
date:      Wed Nov 22 15:11:26 2017 +0000

description:
Pull up following revision(s) (requested by tsutsui in ticket #375):
        common/dist/zlib/inflate.c: revision 1.6
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.

diffstat:

 common/dist/zlib/inflate.c |  9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diffs (26 lines):

diff -r 1574bd79d918 -r da7600de25a0 common/dist/zlib/inflate.c
--- a/common/dist/zlib/inflate.c        Wed Nov 22 14:56:30 2017 +0000
+++ b/common/dist/zlib/inflate.c        Wed Nov 22 15:11:26 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: inflate.c,v 1.5 2017/01/10 01:27:41 christos Exp $     */
+/*     $NetBSD: inflate.c,v 1.5.6.1 2017/11/22 15:11:26 martin Exp $   */
 
 /* inflate.c -- zlib decompression
  * Copyright (C) 1995-2016 Mark Adler
@@ -644,9 +644,16 @@
     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 */



Home | Main Index | Thread Index | Old Index