Subject: | [PATCH] Handle copy-on-write scalars |
See ticket #81352. Compress::Raw::Zlib needs the same treatment.
Subject: | open_SvuRUjvz.txt |
diff --git a/Zlib.xs b/Zlib.xs
index c6558c0..58aa308 100644
--- a/Zlib.xs
+++ b/Zlib.xs
@@ -1333,8 +1333,11 @@ inflate (s, buf, output, eof=FALSE)
/* If the buffer is a reference, dereference it */
buf = deRef(buf, "inflate") ;
- if (s->flags & FLAG_CONSUME_INPUT && SvREADONLY(buf))
+ if (s->flags & FLAG_CONSUME_INPUT) {
+ if (SvREADONLY(buf))
croak("Compress::Raw::Zlib::Inflate::inflate input parameter cannot be read-only when ConsumeInput is specified");
+ SvPV_force(buf,PL_na);
+ }
#ifdef UTF8_AVAILABLE
if (DO_UTF8(buf) && !sv_utf8_downgrade(buf, 1))
croak("Wide character in Compress::Raw::Zlib::Inflate::inflate input parameter");