summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBert Vermeulen <bert@biot.com>2012-01-19 00:00:02 +0100
committerBert Vermeulen <bert@biot.com>2012-01-19 15:07:40 +0100
commit130ef08ad86df267f14901a895ffd5ee46696c72 (patch)
tree94ebc749bafc43ef65583455c43fb646c454f1a7
parent639c56898e88aae99a7b91a5c6d2b7870956d648 (diff)
downloadlibsigrokdecode-130ef08ad86df267f14901a895ffd5ee46696c72.tar.gz
libsigrokdecode-130ef08ad86df267f14901a895ffd5ee46696c72.zip
accept only supported types in decoder class default option values
-rw-r--r--controller.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/controller.c b/controller.c
index f5e272e..ebda088 100644
--- a/controller.c
+++ b/controller.c
@@ -204,6 +204,10 @@ int srd_instance_set_options(struct srd_decoder_instance *di,
goto err_out;
if (!(py_classval = PyList_GetItem(py_optlist, 1)))
goto err_out;
+ if (!PyUnicode_Check(py_classval) && !PyLong_Check(py_classval)) {
+ srd_err("Options of type %s are not yet supported.", Py_TYPE(py_classval)->tp_name);
+ goto err_out;
+ }
if ((value = g_hash_table_lookup(options, key))) {
/* An override for this option was provided. */