summaryrefslogtreecommitdiff
path: root/doio.c
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2020-11-18 14:26:38 +1100
committerTony Cook <tony@develop-help.com>2020-11-24 13:35:21 +1100
commit6987f4434e4dfee71506125954ee1ae41c46f1cb (patch)
treed90c309375e0f503852bccefd029b061cb614152 /doio.c
parentaa058ea4938983be8517ca4ac1dbcdf62cd96da2 (diff)
downloadperl-6987f4434e4dfee71506125954ee1ae41c46f1cb.tar.gz
msgrcv: properly downgrade the receive buffer
If the receive buffer started with SVf_UTF8 on, the received message SV would stay flagged, corrupting the result.
Diffstat (limited to 'doio.c')
-rw-r--r--doio.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/doio.c b/doio.c
index aa6c35bd15..df6e62c0f3 100644
--- a/doio.c
+++ b/doio.c
@@ -3141,6 +3141,7 @@ Perl_do_msgrcv(pTHX_ SV **mark, SV **sp)
}
if (ret >= 0) {
SvCUR_set(mstr, sizeof(long)+ret);
+ SvPOK_only(mstr);
*SvEND(mstr) = '\0';
/* who knows who has been playing with this message? */
SvTAINTED_on(mstr);