[pypy-commit] pypy reflex-support: fix mem-overwrite

wlav noreply at buildbot.pypy.org
Thu Jul 12 09:10:28 CEST 2012


Author: Wim Lavrijsen <WLavrijsen at lbl.gov>
Branch: reflex-support
Changeset: r56034:0625d894fb06
Date: 2012-07-11 12:39 -0700
http://bitbucket.org/pypy/pypy/changeset/0625d894fb06/

Log:	fix mem-overwrite

diff --git a/pypy/module/cppyy/src/cintcwrapper.cxx b/pypy/module/cppyy/src/cintcwrapper.cxx
--- a/pypy/module/cppyy/src/cintcwrapper.cxx
+++ b/pypy/module/cppyy/src/cintcwrapper.cxx
@@ -342,7 +342,11 @@
     // allowing the reuse of method to index the stored bytecodes
         G__CallFunc callf;
         callf.SetFunc(g_interpreted[(size_t)method]);
-        callf.SetArgs(*libp);
+        G__param p;      // G__param has fixed size; libp is sized to nargs
+        for (int i =0; i<nargs; ++i)
+            p.para[i] = libp->para[i];
+        p.paran = nargs;
+        callf.SetArgs(p);     // will copy p yet again
         return callf.Execute((void*)self);
     }
 


More information about the pypy-commit mailing list