Dolda2000 GitWeb
/
ashd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7a59f41
)
htparser: Fixed readcrtchain bug.
author
Fredrik Tolf
<fredrik@dolda2000.com>
Wed, 10 Nov 2021 18:34:13 +0000
(19:34 +0100)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Wed, 10 Nov 2021 18:34:13 +0000
(19:34 +0100)
src/ssl-gnutls.c
patch
|
blob
|
blame
|
history
diff --git
a/src/ssl-gnutls.c
b/src/ssl-gnutls.c
index
5a44214
..
8e3a825
100644
(file)
--- a/
src/ssl-gnutls.c
+++ b/
src/ssl-gnutls.c
@@
-438,7
+438,7
@@
static int readcrtchain(struct certbuffer *ret, struct charbuf *pem)
for(i = 0, p = NULL; i < sizeof(headers) / sizeof(*headers); i++) {
f = memmem(pem->b, pem->d, headers[i], strlen(headers[i]));
for(i = 0, p = NULL; i < sizeof(headers) / sizeof(*headers); i++) {
f = memmem(pem->b, pem->d, headers[i], strlen(headers[i]));
- if((
p == NULL) || (f < p
))
+ if((
f != NULL) && ((p == NULL) || (f < p)
))
p = f;
}
if(p == NULL)
p = f;
}
if(p == NULL)
@@
-453,7
+453,7
@@
static int readcrtchain(struct certbuffer *ret, struct charbuf *pem)
bufadd(*ret, crt);
for(i = 0, p2 = NULL; i < sizeof(headers) / sizeof(*headers); i++) {
f = memmem(p + 1, pem->d - (p + 1 - pem->b), headers[i], strlen(headers[i]));
bufadd(*ret, crt);
for(i = 0, p2 = NULL; i < sizeof(headers) / sizeof(*headers); i++) {
f = memmem(p + 1, pem->d - (p + 1 - pem->b), headers[i], strlen(headers[i]));
- if((
p2 == NULL) || (f < p2
))
+ if((
f != NULL) && ((p2 == NULL) || (f < p2)
))
p2 = f;
}
} while((p = p2) != NULL);
p2 = f;
}
} while((p = p2) != NULL);