From f99cb7d7ab98117fb757430ea9651d4015f180b2 Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Thu, 9 Sep 2021 04:08:26 -0400 Subject: [PATCH] [core] quiet coverity warnings --- src/http-header-glue.c | 6 ++++++ src/network.c | 3 +++ 2 files changed, 9 insertions(+) diff --git a/src/http-header-glue.c b/src/http-header-glue.c index 78421625..38a3a76d 100644 --- a/src/http-header-glue.c +++ b/src/http-header-glue.c @@ -833,6 +833,9 @@ static int http_response_process_headers(request_st * const restrict r, http_res end[0] = '\0'; int status = http_header_str_to_code(value); if (status >= 100 && status < 1000) { + #ifdef __COVERITY__ /* Coverity false positive for tainted */ + status = 200;/* http_header_str_to_code() validates */ + #endif r->http_status = status; opts->local_redir = 0; /*(disable; status was set)*/ } @@ -854,6 +857,9 @@ static int http_response_process_headers(request_st * const restrict r, http_res end[0] = '\0'; int status = http_header_str_to_code(value); if (status >= 100 && status < 1000) { + #ifdef __COVERITY__ /* Coverity false positive for tainted */ + status = 200;/* http_header_str_to_code() validates */ + #endif r->http_status = status; opts->local_redir = 0; /*(disable; status was set)*/ } diff --git a/src/network.c b/src/network.c index 49ceea11..f3a16218 100644 --- a/src/network.c +++ b/src/network.c @@ -735,6 +735,9 @@ int network_init(server *srv, int stdin_fd) { buffer_append_string_len(b, CONST_STR_LEN(":")); buffer_append_int(b, srv->srvconf.port); } + #ifdef __COVERITY__ + force_assert(b->ptr); + #endif rc = network_server_init(srv, &p->defaults, b, 0, -1); buffer_free(b);