aboutsummaryrefslogtreecommitdiffstats
path: root/ctracecmd.i
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2010-05-14 17:38:59 -0400
committerSteven Rostedt <rostedt@goodmis.org>2010-05-17 21:32:36 -0400
commit034e298681d014e082b351f7d4f389662ad29a70 (patch)
treebdbd8db9df04a66cf1e12fdab9e84aa491cb89d7 /ctracecmd.i
parent7f5d32e4df32e08c02d79ae93b2873373c99ea48 (diff)
swig: Enforce non-NULL
Currently, the application segfaults if you pass None (from python) to any of the API functions that don't expect a NULL value. Fix this by marking them NONNULL in swig which will cause a ValueError. Acked-by: Darren Hart <dvhltc@us.ibm.com> Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'ctracecmd.i')
-rw-r--r--ctracecmd.i6
1 files changed, 5 insertions, 1 deletions
diff --git a/ctracecmd.i b/ctracecmd.i
index 10ade49..51e98d5 100644
--- a/ctracecmd.i
+++ b/ctracecmd.i
@@ -1,6 +1,10 @@
1// tracecmd.i 1// tracecmd.i
2%module ctracecmd 2%module ctracecmd
3%include typemaps.i 3%include "typemaps.i"
4%include "constraints.i"
5
6%apply Pointer NONNULL { struct tracecmd_input *handle };
7%apply Pointer NONNULL { struct pevent *pevent };
4 8
5/* return a (rec,cpu) tuple in python */ 9/* return a (rec,cpu) tuple in python */
6extern struct record *tracecmd_read_at(struct tracecmd_input *handle, 10extern struct record *tracecmd_read_at(struct tracecmd_input *handle,