autofs-5.1.9 - fix incorrect allocation in match_key() From: Ian Kent There's a mistake in the length of the string used in matching amd map keys in the ldap module match_key() function. Signed-off-by: Ian Kent --- CHANGELOG | 1 + modules/lookup_ldap.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 3d399ffaf..04d70ed0f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -46,6 +46,7 @@ - initialise process variables in log_pidinfo(). - fix incorrect error handling in sasl_do_kinit_ext_cc(). - fix off by one error in macro_init(). +- fix incorrect allocation in match_key(). 02/11/2023 autofs-5.1.9 - fix kernel mount status notification. diff --git a/modules/lookup_ldap.c b/modules/lookup_ldap.c index 53416c6fc..d27a6bb83 100644 --- a/modules/lookup_ldap.c +++ b/modules/lookup_ldap.c @@ -3721,7 +3721,7 @@ static int match_key(struct autofs_point *ap, char *match; size_t len; *prefix = '\0'; - len = strlen(lkp_key + 3); + len = strlen(lkp_key) + 3; match = malloc(len); if (!match) { char *estr = strerror_r(errno, buf, MAX_ERR_BUF);