summaryrefslogtreecommitdiffstats
path: root/compat/zlib/contrib/puff/puff.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2013-08-14 18:00:45 (GMT)
committerdgp <dgp@users.sourceforge.net>2013-08-14 18:00:45 (GMT)
commita733cde27c904a40aae56e93c7daa369e2a4d045 (patch)
tree77fdf9d45381002ae272a660dd3090c4d9459dc5 /compat/zlib/contrib/puff/puff.c
parent133a3b34b7419b202d6588f44871ea67176a5064 (diff)
parent2b3657769b1d0b9ae6e10113b1d3c038b4967899 (diff)
downloadtcl-a733cde27c904a40aae56e93c7daa369e2a4d045.zip
tcl-a733cde27c904a40aae56e93c7daa369e2a4d045.tar.gz
tcl-a733cde27c904a40aae56e93c7daa369e2a4d045.tar.bz2
merge trunk
Diffstat (limited to 'compat/zlib/contrib/puff/puff.c')
-rw-r--r--compat/zlib/contrib/puff/puff.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/compat/zlib/contrib/puff/puff.c b/compat/zlib/contrib/puff/puff.c
index df8470c..ba58483 100644
--- a/compat/zlib/contrib/puff/puff.c
+++ b/compat/zlib/contrib/puff/puff.c
@@ -1,8 +1,8 @@
/*
* puff.c
- * Copyright (C) 2002-2010 Mark Adler
+ * Copyright (C) 2002-2013 Mark Adler
* For conditions of distribution and use, see copyright notice in puff.h
- * version 2.2, 25 Apr 2010
+ * version 2.3, 21 Jan 2013
*
* puff.c is a simple inflate written to be an unambiguous way to specify the
* deflate format. It is not written for speed but rather simplicity. As a
@@ -76,6 +76,7 @@
* - Move NIL to puff.h
* - Allow incomplete code only if single code length is 1
* - Add full code coverage test to Makefile
+ * 2.3 21 Jan 2013 - Check for invalid code length codes in dynamic blocks
*/
#include <setjmp.h> /* for setjmp(), longjmp(), and jmp_buf */
@@ -704,6 +705,8 @@ local int dynamic(struct state *s)
int len; /* last length to repeat */
symbol = decode(s, &lencode);
+ if (symbol < 0)
+ return symbol; /* invalid symbol */
if (symbol < 16) /* length in 0..15 */
lengths[index++] = symbol;
else { /* repeat instruction */