[svn:parrot] r39505 - trunk/src

cotto at svn.parrot.org cotto at svn.parrot.org
Thu Jun 11 04:09:13 UTC 2009


Author: cotto
Date: Thu Jun 11 04:09:10 2009
New Revision: 39505
URL: https://trac.parrot.org/parrot/changeset/39505

Log:
[freeze/thaw] Make ft_init slightly more paranoid about checking header version numbers.

Modified:
   trunk/src/pmc_freeze.c

Modified: trunk/src/pmc_freeze.c
==============================================================================
--- trunk/src/pmc_freeze.c	Thu Jun 11 03:38:07 2009	(r39504)
+++ trunk/src/pmc_freeze.c	Thu Jun 11 04:09:10 2009	(r39505)
@@ -1040,6 +1040,15 @@
                 EXCEPTION_INVALID_STRING_REPRESENTATION,
                 "bad string to thaw");
         }
+
+        /*TT 474: use the validation logic from Packfile_unpack */
+        if (pf->header->bc_major != PARROT_PBC_MAJOR
+        ||  pf->header->bc_minor != PARROT_PBC_MINOR )
+            Parrot_ex_throw_from_c_args(interp, NULL,
+                    EXCEPTION_INVALID_STRING_REPRESENTATION,
+                    "can't thaw a PMC from Parrot %d.%d", pf->header->bc_major,
+                    pf->header->bc_minor);
+
         mem_sys_memcopy(pf->header, s->strstart, PACKFILE_HEADER_BYTES);
         PackFile_assign_transforms(pf);
         s->bufused -= header_length;


More information about the parrot-commits mailing list