From 86dfbd3c47ce88107922052280c0fb613eda6a54 Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 6 May 2008 15:56:21 +0000 Subject: * ext/zlib/zlib.c (gzreader_gets): may cause infinite loop. [ruby-reference-manual:762] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/zlib/zlib.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ext/zlib') diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index 2546daade5..47e53dceeb 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -3016,6 +3016,8 @@ gzreader_gets(int argc, VALUE *argv, VALUE obj) if (NIL_P(rs)) { dst = gzfile_read_all(gz); if (RSTRING_LEN(dst) != 0) gz->lineno++; + else + return Qnil; return dst; } -- cgit v1.2.3