From: Father Chrysostomos Date: Thu, 12 Dec 2013 23:26:01 +0000 (-0800) Subject: XS::APItest: Flatten src for utf16_to_utf8_reversed X-Git-Tag: upstream/5.20.0~761^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a4d7a71bfbcf858b69074d4736f0d350903d6779;p=platform%2Fupstream%2Fperl.git XS::APItest: Flatten src for utf16_to_utf8_reversed utf16_to_utf8_reversed (the C function) modifies its input, so the XS function of the same name should flatten the input to avoid modifying shared buffers. Brought to you by PERL_DEBUG_READONLY_COW. --- diff --git a/ext/XS-APItest/APItest.xs b/ext/XS-APItest/APItest.xs index 1b8ec3f..f8fc1bf 100644 --- a/ext/XS-APItest/APItest.xs +++ b/ext/XS-APItest/APItest.xs @@ -2480,6 +2480,7 @@ utf16_to_utf8 (sv, ...) SV *dest; I32 got; /* Gah, badly thought out APIs */ CODE: + if (ix) (void)SvPV_force_nolen(sv); source = (U8 *)SvPVbyte(sv, len); /* Optionally only convert part of the buffer. */ if (items > 1) {