From 9248f16ed8bee98d335d361d5a664283fea8c80a Mon Sep 17 00:00:00 2001 From: Arran Cudbard-Bell Date: Mon, 10 Dec 2012 16:05:09 +0000 Subject: [PATCH] user_dn should be initialised to NULL Need to use memcpy to copy pointer to array element into value field in mods struct, because OpenLDAP doesn't use const anywhere --- src/modules/rlm_ldap/rlm_ldap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/rlm_ldap/rlm_ldap.c b/src/modules/rlm_ldap/rlm_ldap.c index 85dcff2..f139842 100644 --- a/src/modules/rlm_ldap/rlm_ldap.c +++ b/src/modules/rlm_ldap/rlm_ldap.c @@ -1826,7 +1826,7 @@ static int ldap_authorize(void *instance, REQUEST * request) int rcode; int module_rcode = RLM_MODULE_OK; ldap_instance *inst = instance; - char *user_dn; + char *user_dn = NULL; char **vals; VALUE_PAIR *vp; LDAP_CONN *conn; @@ -2245,7 +2245,7 @@ static int user_modify(ldap_instance *inst, REQUEST *request, passed[last_pass] = p; } else { - passed[last_pass] = value; + memcpy(&(passed[last_pass]), value, sizeof(passed[last_pass])); } passed[last_pass + 1] = NULL; -- 2.1.4