From 0946fe1617aa04c1feb26c395fa3ba49cf0e5916 Mon Sep 17 00:00:00 2001 From: florent <florent@laas.fr> Date: Fri, 17 Dec 2010 14:44:06 +0100 Subject: [PATCH] Check that argument is string when string is expected in command. * src/entity-py.cc. --- src/entity-py.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/entity-py.cc b/src/entity-py.cc index 58ba371..86255cc 100644 --- a/src/entity-py.cc +++ b/src/entity-py.cc @@ -226,6 +226,10 @@ namespace dynamicgraph { return Value(dvalue); break; case (Value::STRING) : + if (!PyString_Check(pyObject)) { + throw ExceptionFactory(ExceptionFactory::GENERIC, + "string"); + } svalue = PyString_AsString(pyObject); return Value(svalue); break; -- GitLab