summaryrefslogtreecommitdiff
path: root/plugins/pychrysa/analysis/db/items
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/pychrysa/analysis/db/items')
-rw-r--r--plugins/pychrysa/analysis/db/items/comment.c5
-rw-r--r--plugins/pychrysa/analysis/db/items/module.c18
2 files changed, 12 insertions, 11 deletions
diff --git a/plugins/pychrysa/analysis/db/items/comment.c b/plugins/pychrysa/analysis/db/items/comment.c
index 1bb2863..951f6ce 100644
--- a/plugins/pychrysa/analysis/db/items/comment.c
+++ b/plugins/pychrysa/analysis/db/items/comment.c
@@ -75,6 +75,9 @@ static PyObject *py_db_comment_new(PyTypeObject *type, PyObject *args, PyObject
ret = PyArg_ParseTuple(args, "Osp", &py_vmpa, &text, &is_volatile);
if (!ret) Py_RETURN_NONE;
+ ret = PyObject_IsInstance(py_vmpa, (PyObject *)get_python_vmpa_type());
+ if (!ret) return NULL;
+
addr = get_internal_vmpa(py_vmpa);
if (py_vmpa == NULL) Py_RETURN_NONE;
@@ -114,7 +117,7 @@ static PyObject *py_db_comment_get_text(PyObject *self, void *closure)
}
-/*********************d*********************************************************
+/******************************************************************************
* *
* Paramètres : self = objet Python concerné par l'appel. *
* value = valeur fournie à intégrer ou prendre en compte. *
diff --git a/plugins/pychrysa/analysis/db/items/module.c b/plugins/pychrysa/analysis/db/items/module.c
index 3c634e3..009e823 100644
--- a/plugins/pychrysa/analysis/db/items/module.c
+++ b/plugins/pychrysa/analysis/db/items/module.c
@@ -25,6 +25,9 @@
#include "module.h"
+#include <assert.h>
+
+
#include "comment.h"
@@ -64,27 +67,22 @@ bool add_analysis_db_items_module_to_python_module(PyObject *super)
if (module == NULL) return false;
ret = PyState_AddModule(super, &py_chrysalide_items_module);
- if (ret != 0) goto aadimtpm_exit;
+ if (ret != 0) goto loading_failed;
ret = _PyImport_FixupBuiltin(module, "pychrysalide.analysis.db.items");
- if (ret != 0) goto aadimtpm_exit;
+ if (ret != 0) goto loading_failed;
Py_INCREF(module);
ret = PyModule_AddObject(super, "items", module);
- if (ret != 0) goto aadimtpm_exit;
+ if (ret != 0) goto loading_failed;
result = true;
result &= register_python_db_comment(module);
- aadimtpm_exit:
-
- if (!result)
- {
- printf("something went wrong in %s...\n", __FUNCTION__);
- /* ... */
+ loading_failed:
- }
+ assert(result);
return result;