[ekiga] Fixing a crash in the LDAP code (bug #583350)



commit 95bb55027199ed2dc388a84b50a633e0361e8a91
Author: Julien Puydt <jpuydt gnome org>
Date:   Thu May 21 15:37:12 2009 +0200

    Fixing a crash in the LDAP code (bug #583350)
    
    The problem is that strcasecmp needs two non-NULL strings... and only the first one was checked :-(
---
 lib/engine/components/ldap/ldap-book.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/engine/components/ldap/ldap-book.cpp b/lib/engine/components/ldap/ldap-book.cpp
index 7e39b79..fafc53a 100644
--- a/lib/engine/components/ldap/ldap-book.cpp
+++ b/lib/engine/components/ldap/ldap-book.cpp
@@ -91,7 +91,7 @@ OPENLDAP::Book::parse_result (LDAPMessage* message)
   while (rc == LDAP_SUCCESS) {
     rc = ldap_get_attribute_ber (ldap_context, message, ber, &bv, &bvals);
     if (bv.bv_val == NULL) break;
-    if (!strcasecmp(bv.bv_val, attributes[0])) {
+    if (attributes[0] == NULL || !strcasecmp(bv.bv_val, attributes[0])) {
       username = std::string (bvals[0].bv_val, bvals[0].bv_len);
     } else {
       for (i=1; attributes[i]; i++) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]