]> git.vpit.fr Git - perl/modules/Variable-Magic.git/commitdiff
Make sure all entries of MY_CXT.b__op_stashes are initialized
authorVincent Pit <vince@profvince.com>
Sat, 4 Aug 2012 23:18:02 +0000 (01:18 +0200)
committerVincent Pit <vince@profvince.com>
Sun, 5 Aug 2012 10:43:58 +0000 (12:43 +0200)
Otherwise CLONE may be testing uninitialized memory areas.

Magic.xs

index 997b45d233a1e675f16a51577fb502d1684aba29..24f8d5c97da6aa091ef6a5386c159a676b1ce803 100644 (file)
--- a/Magic.xs
+++ b/Magic.xs
@@ -1464,9 +1464,11 @@ PROTOTYPES: ENABLE
 BOOT:
 {
  HV *stash;
+ int c;
 
  MY_CXT_INIT;
- MY_CXT.b__op_stashes[0] = NULL;
+ for (c = OPc_NULL; c < OPc_MAX; ++c)
+  MY_CXT.b__op_stashes[c] = NULL;
 #if VMG_THREADSAFE
  MUTEX_INIT(&vmg_vtable_refcount_mutex);
  MUTEX_INIT(&vmg_op_name_init_mutex);