[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 146/222: ldap: fix OOM error on missing query string
From: |
gnunet |
Subject: |
[gnurl] 146/222: ldap: fix OOM error on missing query string |
Date: |
Thu, 07 Nov 2019 00:10:42 +0100 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit 8bb3a95ce1577e2c8282e7d1c2830bde87cf5c3b
Author: Nicolas <address@hidden>
AuthorDate: Fri Oct 4 22:49:43 2019 -0300
ldap: fix OOM error on missing query string
- Allow missing queries, don't return NO_MEMORY error in such a case.
It is acceptable for there to be no specified query string, for example:
curl ldap://ldap.forumsys.com
A regression bug in 1b443a7 caused this issue.
This is a partial fix for #4261.
Bug: https://github.com/curl/curl/issues/4261#issuecomment-525543077
Reported-by: address@hidden
Analyzed-by: Samuel Surtees
Closes https://github.com/curl/curl/pull/4467
---
lib/ldap.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/lib/ldap.c b/lib/ldap.c
index d7d90fea7..af3d61c57 100644
--- a/lib/ldap.c
+++ b/lib/ldap.c
@@ -844,10 +844,10 @@ static bool split_str(char *str, char ***out, size_t
*count)
static int _ldap_url_parse2(const struct connectdata *conn, LDAPURLDesc *ludp)
{
int rc = LDAP_SUCCESS;
- char *path;
- char *query;
char *p;
- char *q;
+ char *path;
+ char *q = NULL;
+ char *query = NULL;
size_t i;
if(!conn->data ||
@@ -865,11 +865,13 @@ static int _ldap_url_parse2(const struct connectdata
*conn, LDAPURLDesc *ludp)
if(!path)
return LDAP_NO_MEMORY;
- /* Duplicate the query */
- q = query = strdup(conn->data->state.up.query);
- if(!query) {
- free(path);
- return LDAP_NO_MEMORY;
+ /* Duplicate the query if present */
+ if(conn->data->state.up.query) {
+ q = query = strdup(conn->data->state.up.query);
+ if(!query) {
+ free(path);
+ return LDAP_NO_MEMORY;
+ }
}
/* Parse the DN (Distinguished Name) */
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [gnurl] 134/222: ESNI: initial build/setup, (continued)
- [gnurl] 134/222: ESNI: initial build/setup, gnunet, 2019/11/06
- [gnurl] 135/222: CURLMOPT_MAX_CONCURRENT_STREAMS.3: fix SEE ALSO typo, gnunet, 2019/11/06
- [gnurl] 141/222: ngtcp2: adapt to API change, gnunet, 2019/11/06
- [gnurl] 140/222: cookies: change argument type for Curl_flush_cookies, gnunet, 2019/11/06
- [gnurl] 142/222: winbuild: add ENABLE_UNICODE option, gnunet, 2019/11/06
- [gnurl] 145/222: build: Remove unused HAVE_LIBSSL and HAVE_LIBCRYPTO defines, gnunet, 2019/11/06
- [gnurl] 151/222: cirrus: Switch the FreeBSD 11.x build to 11.3 and add a 13.0 build., gnunet, 2019/11/06
- [gnurl] 148/222: CURLOPT_TIMEOUT.3: remove the mention of "minutes", gnunet, 2019/11/06
- [gnurl] 143/222: curl: ensure HTTP 429 triggers --retry, gnunet, 2019/11/06
- [gnurl] 149/222: TODO: Consult %APPDATA% also for .netrc, gnunet, 2019/11/06
- [gnurl] 146/222: ldap: fix OOM error on missing query string,
gnunet <=
- [gnurl] 138/222: urlapi: fix use-after-free bug, gnunet, 2019/11/06
- [gnurl] 153/222: docs: make sure the --no-progress-meter docs file is in dist too, gnunet, 2019/11/06
- [gnurl] 154/222: cirrus: Increase the git clone depth., gnunet, 2019/11/06
- [gnurl] 152/222: docs: document it as --no-progress-meter instead of the reverse, gnunet, 2019/11/06
- [gnurl] 159/222: RELEASE-NOTES: synced, gnunet, 2019/11/06
- [gnurl] 157/222: cirrus: switch off blackhole status on the freebsd CI machines, gnunet, 2019/11/06
- [gnurl] 106/222: vtls: Fix comment typo about macosx-version-min compiler flag, gnunet, 2019/11/06
- [gnurl] 136/222: docs: add note on failed handles not being counted by curl_multi_perform, gnunet, 2019/11/06
- [gnurl] 139/222: http2: move state-init from creation to pre-transfer, gnunet, 2019/11/06
- [gnurl] 144/222: RELEASE-NOTES: synced, gnunet, 2019/11/06