aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_config_ldap.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-03-06 05:25:05 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-03-06 05:25:05 +0000
commita1b4ff33f4791b241fa4f5fdb63a8e0344bc5baf (patch)
tree218065e17a5382f95c6b330ee910ccdfe5d6b740 /res/res_config_ldap.c
parente1b91b0c95e85ea9cdcf53829b5113ffdd4bee8c (diff)
Merged revisions 106346 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r106346 | tilghman | 2008-03-05 23:21:39 -0600 (Wed, 05 Mar 2008) | 7 lines Missing braces, fix parsing (closes issue #12112) Reported by: cyrenity Patches: res_config_ldap.patch-03-03-2008 uploaded by cyrenity (license 416) Tested by: cyrenity, Corydon76 ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@106359 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_config_ldap.c')
-rw-r--r--res/res_config_ldap.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/res/res_config_ldap.c b/res/res_config_ldap.c
index ab71d8b7e..56f95ac01 100644
--- a/res/res_config_ldap.c
+++ b/res/res_config_ldap.c
@@ -687,7 +687,9 @@ static void append_var_and_value_to_filter(struct ast_str **filter,
ast_debug(2, "name='%s' value='%s'\n", name, value);
if (like_pos) {
- name = new_name = ast_strdupa(like_pos + strlen(" LIKE"));
+ int len = like_pos - name;
+ name = new_name = ast_strdupa(name);
+ new_name[len] = '\0';
value = new_value = ast_strdupa(value);
replace_string_in_string(new_value, "\\_", "_");
replace_string_in_string(new_value, "%", "*");
@@ -725,9 +727,10 @@ static struct ast_variable **realtime_ldap_base_ap(unsigned int *entries_count_p
return NULL;
}
- if (!(filter = ast_str_create(80)))
+ if (!(filter = ast_str_create(80))) {
ast_free(clean_basedn);
return NULL;
+ }
/* Get the first parameter and first value in our list of passed paramater/value pairs */
newparam = va_arg(ap, const char *);