summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/pychrysa/analysis/db/items/comment.c19
-rw-r--r--plugins/readelf/header.c2
2 files changed, 17 insertions, 4 deletions
diff --git a/plugins/pychrysa/analysis/db/items/comment.c b/plugins/pychrysa/analysis/db/items/comment.c
index 4a90f09..1062cc9 100644
--- a/plugins/pychrysa/analysis/db/items/comment.c
+++ b/plugins/pychrysa/analysis/db/items/comment.c
@@ -25,6 +25,7 @@
#include "comment.h"
+#include <malloc.h>
#include <pygobject.h>
@@ -108,13 +109,25 @@ static PyObject *py_db_comment_new(PyTypeObject *type, PyObject *args, PyObject
static PyObject *py_db_comment_get_text(PyObject *self, void *closure)
{
+ PyObject *result; /* Résultat à retourner */
GDbComment *comment; /* Commentaire à consulter */
- const char *content; /* Contenu textuel associé */
+ char *text; /* Contenu textuel associé */
comment = G_DB_COMMENT(pygobject_get(self));
- content = g_db_comment_get_text(comment);
+ text = g_db_comment_get_text(comment);
- return PyUnicode_FromString(content);
+ if (text == NULL)
+ {
+ result = Py_None;
+ Py_INCREF(result);
+ }
+ else
+ {
+ result = PyUnicode_FromString(text);
+ free(text);
+ }
+
+ return result;
}
diff --git a/plugins/readelf/header.c b/plugins/readelf/header.c
index 75e30fe..d0aee92 100644
--- a/plugins/readelf/header.c
+++ b/plugins/readelf/header.c
@@ -70,7 +70,7 @@ bool annotate_elf_header(GElfFormat *format)
SET_IMM_DISPLAY(instr, operand, 2, IOD_CHAR);
SET_IMM_DISPLAY(instr, operand, 3, IOD_CHAR);
- ADD_RAW_AS_SYM(format, symbol, instr, comment, _("ELF magic number"));
+ ADD_RAW_AS_SYM_CST(format, symbol, instr, comment, _("ELF magic number"));
/* EI_CLASS (4) */