[ekiga/gnome-2-26] Fixing a crash in the LDAP code (bug #583350)
- From: Julien Puydt <jpuydt src gnome org>
- To: svn-commits-list gnome org
- Subject: [ekiga/gnome-2-26] Fixing a crash in the LDAP code (bug #583350)
- Date: Thu, 21 May 2009 10:47:40 -0400 (EDT)
commit 3b326e485d792051575ece30e49083c5642ef11b
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 7675110..8f36532 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]