fix potential NULL dereferences.

found by clang --analyze, reminded by fahlgren@
This commit is contained in:
Joris Vink 2019-11-13 11:23:02 +01:00
parent ff2d961be7
commit 7cf0006f52
2 changed files with 3 additions and 1 deletions

View File

@ -1991,7 +1991,7 @@ http_response_normal(struct http_request *req, struct connection *c,
kore_buf_append(header_buf, http_version, http_version_len);
if ((c->flags & CONN_CLOSE_EMPTY) ||
(req->flags & HTTP_VERSION_1_0)) {
(req != NULL && (req->flags & HTTP_VERSION_1_0))) {
connection_close = 1;
} else {
connection_close = 0;

View File

@ -627,6 +627,8 @@ kore_worker_keymgr_response_verify(struct kore_msg *msg, const void *data,
if (out == NULL)
return (KORE_RESULT_OK);
dom = NULL;
LIST_FOREACH(srv, &kore_servers, list) {
dom = NULL;