summaryrefslogtreecommitdiffstats
path: root/ext/zlib/zlib.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-06 15:56:21 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-06 15:56:21 +0000
commit8adf7ee71fe66f198d6001c2654860c117f39eec (patch)
tree99395e285e89cebf96588ad32ef5b242b866bb9f /ext/zlib/zlib.c
parente180640d13f5da7ca264e4cf2d1a809933c70b0d (diff)
downloadruby-8adf7ee71fe66f198d6001c2654860c117f39eec.tar.gz
ruby-8adf7ee71fe66f198d6001c2654860c117f39eec.tar.xz
ruby-8adf7ee71fe66f198d6001c2654860c117f39eec.zip
* ext/zlib/zlib.c (gzreader_gets): may cause infinite loop.
[ruby-reference-manual:762] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/zlib/zlib.c')
-rw-r--r--ext/zlib/zlib.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index 2546daade..47e53dcee 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;
}