diff options
author | Mark Spruiell <mes@zeroc.com> | 2009-10-27 13:20:39 -0700 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2009-10-27 13:20:39 -0700 |
commit | 370cfa6a7f7a3bb188dfb66bad09f3283a07aab8 (patch) | |
tree | 61b68c219c6c637f8621673d3b96bc8ad624c261 /py/modules/IcePy/ObjectAdapter.cpp | |
parent | bug 4333 - fixing TestUtil issue (diff) | |
download | ice-370cfa6a7f7a3bb188dfb66bad09f3283a07aab8.tar.bz2 ice-370cfa6a7f7a3bb188dfb66bad09f3283a07aab8.tar.xz ice-370cfa6a7f7a3bb188dfb66bad09f3283a07aab8.zip |
bug 4335 - Python segfault
Diffstat (limited to 'py/modules/IcePy/ObjectAdapter.cpp')
-rw-r--r-- | py/modules/IcePy/ObjectAdapter.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/py/modules/IcePy/ObjectAdapter.cpp b/py/modules/IcePy/ObjectAdapter.cpp index c5653e11bdc..e870654cf3c 100644 --- a/py/modules/IcePy/ObjectAdapter.cpp +++ b/py/modules/IcePy/ObjectAdapter.cpp @@ -1159,9 +1159,12 @@ extern "C" static PyObject* adapterFindByProxy(ObjectAdapterObject* self, PyObject* args) { - PyObject* proxyType = lookupType("Ice.ObjectPrx"); + // + // We don't want to accept None here, so we can specify ProxyType and force + // the caller to supply a proxy object. + // PyObject* proxy; - if(!PyArg_ParseTuple(args, STRCAST("O!"), proxyType, &proxy)) + if(!PyArg_ParseTuple(args, STRCAST("O!"), &ProxyType, &proxy)) { return 0; } @@ -1458,14 +1461,19 @@ extern "C" static PyObject* adapterSetLocator(ObjectAdapterObject* self, PyObject* args) { - PyObject* proxyType = lookupType("Ice.LocatorPrx"); - PyObject* proxy; - if(!PyArg_ParseTuple(args, STRCAST("O!"), proxyType, &proxy)) + PyObject* p; + if(!PyArg_ParseTuple(args, STRCAST("O"), &p)) + { + return 0; + } + + Ice::ObjectPrx proxy; + if(!getProxyArg(p, "setLocator", "loc", proxy, "Ice.LocatorPrx")) { return 0; } - Ice::LocatorPrx locator = Ice::LocatorPrx::uncheckedCast(getProxy(proxy)); + Ice::LocatorPrx locator = Ice::LocatorPrx::uncheckedCast(proxy); assert(self->adapter); try |