[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 35/178: openldap: fix for NULL return from ldap_get
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 35/178: openldap: fix for NULL return from ldap_get_attribute_ber() |
Date: |
Wed, 23 May 2018 12:24:30 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit b6e484dc36a2681c0991a274398f917e74517053
Author: Howard Chu <address@hidden>
AuthorDate: Sun Mar 18 18:13:27 2018 +0000
openldap: fix for NULL return from ldap_get_attribute_ber()
Closes #2399
---
lib/openldap.c | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/lib/openldap.c b/lib/openldap.c
index 187c89994..c6cb79434 100644
--- a/lib/openldap.c
+++ b/lib/openldap.c
@@ -536,7 +536,7 @@ static ssize_t ldap_recv(struct connectdata *conn, int
sockindex, char *buf,
data->req.bytecount += bv.bv_len + 5;
for(rc = ldap_get_attribute_ber(li->ld, ent, ber, &bv, &bvals);
- (rc == LDAP_SUCCESS) && bvals;
+ rc == LDAP_SUCCESS;
rc = ldap_get_attribute_ber(li->ld, ent, ber, &bv, &bvals)) {
int i;
@@ -548,6 +548,27 @@ static ssize_t ldap_recv(struct connectdata *conn, int
sockindex, char *buf,
else
binary = 0;
+ if(bvals == NULL) {
+ writeerr = Curl_client_write(conn, CLIENTWRITE_BODY, (char *)"\t", 1);
+ if(writeerr) {
+ *err = writeerr;
+ return -1;
+ }
+ writeerr = Curl_client_write(conn, CLIENTWRITE_BODY, (char *)bv.bv_val,
+ bv.bv_len);
+ if(writeerr) {
+ *err = writeerr;
+ return -1;
+ }
+ writeerr = Curl_client_write(conn, CLIENTWRITE_BODY, (char *)":\n", 2);
+ if(writeerr) {
+ *err = writeerr;
+ return -1;
+ }
+ data->req.bytecount += bv.bv_len + 3;
+ continue;
+ }
+
for(i = 0; bvals[i].bv_val != NULL; i++) {
int binval = 0;
writeerr = Curl_client_write(conn, CLIENTWRITE_BODY, (char *)"\t", 1);
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 29/178: CURLINFO_SSL_VERIFYRESULT.3: fix the example, add some text, (continued)
- [GNUnet-SVN] [gnurl] 29/178: CURLINFO_SSL_VERIFYRESULT.3: fix the example, add some text, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 38/178: runtests.pl: fix warning 'use of uninitialized value', gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 24/178: lib/curl_path.h: add #ifdef header guard, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 33/178: cmake: avoid warn-as-error during config checks (#2411), gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 25/178: vauth/cleartext: fix integer overflow check, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 26/178: CURLINFO_COOKIELIST.3: made the example not leak memory, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 34/178: travis-ci: enable -Werror for CMake builds (#2418), gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 22/178: examples/hiperfifo: checksrc compliance, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 20/178: RELEASE-NOTES: synced, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 37/178: gitignore: ignore more generated files, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 35/178: openldap: fix for NULL return from ldap_get_attribute_ber(),
gnunet <=
- [GNUnet-SVN] [gnurl] 10/178: examples/hiperfifo.c: improved, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 14/178: CURLOPT_HAPROXYPROTOCOL: support the HAProxy PROXY protocol, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 12/178: multi: improved pending transfers handling => improved performance, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 39/178: travis: enable apt retry on fail, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 36/178: threaded resolver: track resolver time and set suitable timeout values, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 30/178: CI: add lgtm.yml for tweaking lgtm.com analysis, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 40/178: TODO: connection cache sharing is now supporte, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 43/178: test1148: set a fixed locale for the test, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 41/178: cmake: Add advapi32 as explicit link library for win32, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 49/178: cookie: case-insensitive hashing for the domains, gnunet, 2018/05/23