summaryrefslogtreecommitdiff
path: root/lib/libz/inffast.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libz/inffast.c')
-rw-r--r--lib/libz/inffast.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/libz/inffast.c b/lib/libz/inffast.c
index 137d8b14d3b..33b9feb54b7 100644
--- a/lib/libz/inffast.c
+++ b/lib/libz/inffast.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: inffast.c,v 1.4 2003/12/16 22:33:02 henning Exp $ */
+/* $OpenBSD: inffast.c,v 1.5 2003/12/17 00:28:19 millert Exp $ */
/* inffast.c -- fast decoding
* Copyright (C) 1995-2003 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
@@ -175,7 +175,11 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
if (dist > op) { /* see if copy from window */
op = dist - op; /* distance back in window */
if (op > whave) {
+#ifdef SMALL
+ strm->msg = "error";
+#else
strm->msg = (char *)"invalid distance too far back";
+#endif
state->mode = BAD;
break;
}
@@ -251,7 +255,11 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
goto dodist;
}
else {
+#ifdef SMALL
+ strm->msg = "error";
+#else
strm->msg = (char *)"invalid distance code";
+#endif
state->mode = BAD;
break;
}
@@ -266,7 +274,11 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
break;
}
else {
+#ifdef SMALL
+ strm->msg = "error";
+#else
strm->msg = (char *)"invalid literal/length code";
+#endif
state->mode = BAD;
break;
}