From 5422d203f05859fa2841e3a68980813806eb9581 Mon Sep 17 00:00:00 2001 From: Sumit Bose Date: Thu, 14 May 2009 12:38:03 +0200 Subject: added check for NULL values - allow unspecified value in struct pam_data to be NULL - check if domain structure is initialized in pam_reply --- server/providers/dp_auth_util.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'server/providers') diff --git a/server/providers/dp_auth_util.c b/server/providers/dp_auth_util.c index 630dafe8c..366a3fb2d 100644 --- a/server/providers/dp_auth_util.c +++ b/server/providers/dp_auth_util.c @@ -59,6 +59,13 @@ bool dp_pack_pam_request(DBusMessage *msg, struct pam_data *pd) { int ret; + if (pd->user == NULL || pd->domain == NULL) return false; + if (pd->service == NULL) pd->service = ""; + if (pd->tty == NULL) pd->tty = ""; + if (pd->ruser == NULL) pd->ruser = ""; + if (pd->rhost == NULL) pd->rhost = ""; + + ret = dbus_message_append_args(msg, DBUS_TYPE_INT32, &(pd->cmd), DBUS_TYPE_STRING, &(pd->domain), -- cgit