summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/python/py_conv.c7
-rw-r--r--source3/python/py_conv.h2
2 files changed, 7 insertions, 2 deletions
diff --git a/source3/python/py_conv.c b/source3/python/py_conv.c
index 2dc12f348a..c6f39515af 100644
--- a/source3/python/py_conv.c
+++ b/source3/python/py_conv.c
@@ -78,7 +78,7 @@ PyObject *from_struct(void *s, struct pyconv *conv)
/* Convert a Python dict to a structure */
-void to_struct(void *s, PyObject *dict, struct pyconv *conv)
+BOOL to_struct(void *s, PyObject *dict, struct pyconv *conv)
{
int i;
@@ -86,6 +86,9 @@ void to_struct(void *s, PyObject *dict, struct pyconv *conv)
PyObject *obj;
obj = PyDict_GetItemString(dict, conv[i].name);
+
+ if (!obj)
+ return False;
switch (conv[i].type) {
case PY_UNISTR: {
@@ -123,4 +126,6 @@ void to_struct(void *s, PyObject *dict, struct pyconv *conv)
break;
}
}
+
+ return True;
}
diff --git a/source3/python/py_conv.h b/source3/python/py_conv.h
index 0de2d674de..ed06b9a852 100644
--- a/source3/python/py_conv.h
+++ b/source3/python/py_conv.h
@@ -30,7 +30,7 @@ struct pyconv {
};
PyObject *from_struct(void *s, struct pyconv *conv);
-void to_struct(void *s, PyObject *dict, struct pyconv *conv);
+BOOL to_struct(void *s, PyObject *dict, struct pyconv *conv);
/* Another version of offsetof (-: */