From: Arran Cudbard-Bell Date: Mon, 10 Dec 2012 16:05:09 +0000 (+0000) Subject: user_dn should be initialised to NULL X-Git-Tag: release_3_0_0_beta1~1394 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9248f16ed8bee98d335d361d5a664283fea8c80a;p=thirdparty%2Ffreeradius-server.git 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 --- diff --git a/src/modules/rlm_ldap/rlm_ldap.c b/src/modules/rlm_ldap/rlm_ldap.c index 85dcff258d3..f1398426847 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;