In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/f49e84642c2886177a0ec4ddff2ef186df4c6441?hp=41b1e858a075694f88057b9514f5fc78c80b5355>

- Log -----------------------------------------------------------------
commit f49e84642c2886177a0ec4ddff2ef186df4c6441
Author: David Mitchell <[email protected]>
Date:   Mon Feb 27 13:15:31 2017 +0000

    S_do_op_dump_bar(): don't print TRANS op_pv field
    
    My recent commit v5.25.9-32-gabd07ec made dump.c display the op_pv
    string of OP_NEXT, OP_TRANS etc ops. However, for OP_TRANS/OP_TRANSR,
    the string is basically a 256-byte potentially non null-temrinated array.
    This was causing a buffer read overrun and garbage to be displayed.
    
    The simple solution is to only display the address but not contents
    for a trans op. OP_NEXT ec labels continue to be displayed.
-----------------------------------------------------------------------

Summary of changes:
 dump.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/dump.c b/dump.c
index 52b52cab08..c5e3a79feb 100644
--- a/dump.c
+++ b/dump.c
@@ -1227,21 +1227,22 @@ S_do_op_dump_bar(pTHX_ I32 level, UV bar, PerlIO *file, 
const OP *o)
     case OP_REDO:
        if (o->op_flags & (OPf_SPECIAL|OPf_STACKED|OPf_KIDS))
            break;
-       /* FALLTHROUGH */
-    case OP_TRANS:
-    case OP_TRANSR:
-       if (   (o->op_type == OP_TRANS || o->op_type == OP_TRANSR)
-            && (o->op_private & (OPpTRANS_FROM_UTF|OPpTRANS_TO_UTF)))
-            break;
-
         {
             SV * const label = newSVpvs_flags("", SVs_TEMP);
             generic_pv_escape(label, cPVOPo->op_pv, strlen(cPVOPo->op_pv), 0);
             S_opdump_indent(aTHX_ o, level, bar, file,
                             "PV = \"%" SVf "\" (0x%" UVxf ")\n",
                             SVfARG(label), PTR2UV(cPVOPo->op_pv));
+            break;
         }
 
+    case OP_TRANS:
+    case OP_TRANSR:
+            S_opdump_indent(aTHX_ o, level, bar, file,
+                            "PV = 0x%" UVxf "\n",
+                            PTR2UV(cPVOPo->op_pv));
+            break;
+
 
     default:
        break;

--
Perl5 Master Repository

Reply via email to