aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2015-12-10 17:30:57 +0100
committerMichael Adam <obnox@samba.org>2015-12-10 23:28:51 +0100
commit52ec969c2c074f2716c8c3bccd7940a84ddee92b (patch)
treeb76ce4d2c7d6b2834da11126cf39fdf09dd1b8ca
parent776a18460f3e259a12a8b07ee52d70676fdb7258 (diff)
downloadpam_wrapper-52ec969c2c074f2716c8c3bccd7940a84ddee92b.tar.gz
pam_wrapper-52ec969c2c074f2716c8c3bccd7940a84ddee92b.tar.xz
pam_wrapper-52ec969c2c074f2716c8c3bccd7940a84ddee92b.zip
py: Make sure we do not dereference a NULL pointer
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
-rw-r--r--src/python/pypamtest.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/python/pypamtest.c b/src/python/pypamtest.c
index 1538294..e342366 100644
--- a/src/python/pypamtest.c
+++ b/src/python/pypamtest.c
@@ -263,6 +263,11 @@ set_pypamtest_exception(PyObject *exc,
const char *strerr;
const struct pam_testcase *failed;
+ if (exc == NULL) {
+ PyErr_BadArgument();
+ return;
+ }
+
strerr = pamtest_strerror(perr);
if (perr == PAMTEST_ERR_CASE) {