[exim-dev] [Bug 2251] Segfault when LDAP lookup does not ret…

Etusivu
Poista viesti
Vastaa
Lähettäjä: admin
Päiväys:  
Vastaanottaja: exim-dev
Aihe: [exim-dev] [Bug 2251] Segfault when LDAP lookup does not return a result
https://bugs.exim.org/show_bug.cgi?id=2251

--- Comment #16 from Matthew Slowe <M.Slowe@???> ---
(In reply to Jeremy Harris from comment #15)
> Where you have $value, put
> ${if def:value {$value}{$local_part}}


That's now live with the updated config and the following patch added on top of
EPEL's patches:

diff --git a/src/lookups/ldap.c b/src/lookups/ldap.c
index 235af0f..06db734 100644
--- a/src/lookups/ldap.c
+++ b/src/lookups/ldap.c
@@ -884,13 +884,13 @@ while ((rc = ldap_result(lcp->ld, msgid, 0, timeoutptr,
&result)) ==
   result = NULL;
   }            /* End "while" loop for multiple results */


-/* Terminate the dynamic string that we have built and reclaim unused store */
+/* Terminate the dynamic string that we have built and reclaim unused store.
+In the odd case of a single attribute with zero-length value, allocate
+an empty string. */

-if (data)
- {
- (void) string_from_gstring(data);
- store_reset(data->s + data->ptr + 1);
- }
+if (!data) data = string_get(1);
+(void) string_from_gstring(data);
+store_reset(data->s + data->ptr + 1);

/* Copy the last dn into eldap_dn */


Is there anything else you'd like me to try?

--
You are receiving this mail because:
You are on the CC list for the bug.