[svn-commits] oej: branch oej/bp-res_conf_ldap-1.4 r239524 - /team/oej/bp-res_conf_ldap-1.4...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Jan 12 12:33:34 CST 2010


Author: oej
Date: Tue Jan 12 12:33:23 2010
New Revision: 239524

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=239524
Log:
Author: seanbright
Date: Tue Jan 12 11:09:12 2010
New Revision: 239473

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=239473
Log:
Fix crash in res_config_ldap.

We need to allocate enough room for 2 pointers, not 2 characters.

(closes issue #16397)
Reported by: bklang
Patches:
     res_config_ldap.patch uploaded by applsplatz (license 949)
Tested by: applsplatz

Modified:
   trunk/res/res_config_ldap.c

Modified:
    team/oej/bp-res_conf_ldap-1.4/res/res_config_ldap.c

Modified: team/oej/bp-res_conf_ldap-1.4/res/res_config_ldap.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/bp-res_conf_ldap-1.4/res/res_config_ldap.c?view=diff&rev=239524&r1=239523&r2=239524
==============================================================================
--- team/oej/bp-res_conf_ldap-1.4/res/res_config_ldap.c (original)
+++ team/oej/bp-res_conf_ldap-1.4/res/res_config_ldap.c Tue Jan 12 12:33:23 2010
@@ -1229,12 +1229,10 @@
 	ldap_mods[0] = ast_calloc(1, sizeof(LDAPMod));
 
 	ldap_mods[0]->mod_op = LDAP_MOD_REPLACE;
-	ldap_mods[0]->mod_type = ast_calloc(sizeof(char), strlen(newparam) + 1);
-	strcpy(ldap_mods[0]->mod_type, newparam);
-
-	ldap_mods[0]->mod_values = ast_calloc(sizeof(char), 2);
-	ldap_mods[0]->mod_values[0] = ast_calloc(sizeof(char), strlen(newval) + 1);
-	strcpy(ldap_mods[0]->mod_values[0], newval);
+	ldap_mods[0]->mod_type = ast_strdup(newparam);
+
+	ldap_mods[0]->mod_values = ast_calloc(sizeof(char *), 2);
+	ldap_mods[0]->mod_values[0] = ast_strdup(newval);
 
 	while ((newparam = va_arg(ap, const char *))) {
 		newparam = convert_attribute_name_to_ldap(table_config, newparam);




More information about the svn-commits mailing list