[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 270/282: cookie: get_top_domain() sets zero length for null doma
From: |
gnunet |
Subject: |
[gnurl] 270/282: cookie: get_top_domain() sets zero length for null domains |
Date: |
Wed, 01 Apr 2020 14:32:15 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit 06a1b821404c176fde883a826a0db712695dd964
Author: Patrick Monnerat <address@hidden>
AuthorDate: Tue Jan 28 10:23:41 2020 +0100
cookie: get_top_domain() sets zero length for null domains
This silents a compilation warning with gcc -O3.
---
lib/cookie.c | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/lib/cookie.c b/lib/cookie.c
index 69bc04260..68054e1c4 100644
--- a/lib/cookie.c
+++ b/lib/cookie.c
@@ -245,18 +245,17 @@ pathmatched:
*/
static const char *get_top_domain(const char * const domain, size_t *outlen)
{
- size_t len;
+ size_t len = 0;
const char *first = NULL, *last;
- if(!domain)
- return NULL;
-
- len = strlen(domain);
- last = memrchr(domain, '.', len);
- if(last) {
- first = memrchr(domain, '.', (last - domain));
- if(first)
- len -= (++first - domain);
+ if(domain) {
+ len = strlen(domain);
+ last = memrchr(domain, '.', len);
+ if(last) {
+ first = memrchr(domain, '.', (last - domain));
+ if(first)
+ len -= (++first - domain);
+ }
}
if(outlen)
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [gnurl] 246/282: multi: skip EINTR check on wakeup socket if it was closed, (continued)
- [gnurl] 246/282: multi: skip EINTR check on wakeup socket if it was closed, gnunet, 2020/04/01
- [gnurl] 253/282: pause: force a connection (re-)check after unpausing, gnunet, 2020/04/01
- [gnurl] 273/282: RELEASE-NOTES: synced, gnunet, 2020/04/01
- [gnurl] 267/282: sha256: Added SecureTransport implementation, gnunet, 2020/04/01
- [gnurl] 265/282: mime: fix the binary encoder to handle large data properly, gnunet, 2020/04/01
- [gnurl] 275/282: runtests: log minimal and maximal used port numbers, gnunet, 2020/04/01
- [gnurl] 279/282: test1129: fix invalid case of closing XML-tag and Content-Length, gnunet, 2020/04/01
- [gnurl] 274/282: sftp: fix segfault regression introduced by #4747, gnunet, 2020/04/01
- [gnurl] 277/282: tests/data: fix static ip:port instead of dynamic values being used, gnunet, 2020/04/01
- [gnurl] 281/282: RELEASE-NOTES: 7.69.1, gnunet, 2020/04/01
- [gnurl] 270/282: cookie: get_top_domain() sets zero length for null domains,
gnunet <=
- [gnurl] 268/282: sha256: Added WinCrypt implementation, gnunet, 2020/04/01
- [gnurl] 264/282: mime: do not perform more than one read in a row, gnunet, 2020/04/01
- [gnurl] 276/282: tests/server: fix missing use of exe_ext helper function, gnunet, 2020/04/01
- [gnurl] 278/282: tests/data: fix static ip instead of dynamic value being used, gnunet, 2020/04/01
- [gnurl] 280/282: THANKS: from the 7.69.1 release, gnunet, 2020/04/01
- [gnurl] 282/282: Merge tag 'curl-7_69_1', gnunet, 2020/04/01