[core] silence coverity warnings (false positives)
This commit is contained in:
parent
1b74c50854
commit
af04e0b0e1
25
src/h2.c
25
src/h2.c
|
@ -1201,6 +1201,13 @@ h2_parse_headers_frame (request_st * const restrict r, const unsigned char *psrc
|
|||
static int
|
||||
h2_recv_headers (connection * const con, uint8_t * const s, uint32_t flen)
|
||||
{
|
||||
#ifdef __COVERITY__
|
||||
/* Coverity does not notice that values used in s are checked.
|
||||
* Although silencing here, would prefer not to do so since doing so
|
||||
* disables Coverity from reporting questionable modifications which
|
||||
* might be made to the code in the future. */
|
||||
__coverity_tainted_data_sink__(s);
|
||||
#endif
|
||||
request_st *r = NULL;
|
||||
h2con * const h2c = con->h2;
|
||||
const uint32_t id =
|
||||
|
@ -2419,16 +2426,16 @@ h2_retire_stream (request_st *r, connection * const con)
|
|||
if (r == NULL) return; /*(should not happen)*/
|
||||
h2con * const h2c = con->h2;
|
||||
request_st ** const ar = h2c->r;
|
||||
for (uint32_t i = 0, j = 0, rused = h2c->rused; i < rused; ++i) {
|
||||
if (ar[i] != r)
|
||||
ar[j++] = ar[i];
|
||||
else {
|
||||
h2_release_stream(r, con);
|
||||
r = NULL;
|
||||
}
|
||||
uint32_t i = 0, rused = h2c->rused;
|
||||
while (i < rused && ar[i] != r) ++i;
|
||||
if (i != rused) {
|
||||
/* swap with last element; might need to revisit if ordered by priority */
|
||||
/*if (i != --rused) ar[i] = ar[rused];*/
|
||||
/* shift elements; currently choosing to preserve order requested */
|
||||
if (i != --rused) memmove(ar+i, ar+i+1, (rused-i)*sizeof(*ar));
|
||||
h2c->r[(h2c->rused = rused)] = NULL;
|
||||
h2_release_stream(r, con);
|
||||
}
|
||||
if (r == NULL) /* found */
|
||||
h2c->r[--h2c->rused] = NULL;
|
||||
/*else ... should not happen*/
|
||||
}
|
||||
|
||||
|
|
|
@ -1593,6 +1593,10 @@ REQUEST_FUNC(mod_deflate_handle_response_start) {
|
|||
rc = deflate_compress_response(r, hctx);
|
||||
if (HANDLER_GO_ON == rc) return HANDLER_GO_ON;
|
||||
if (HANDLER_FINISHED == rc) {
|
||||
#ifdef __COVERITY__
|
||||
/* coverity misses if hctx->cache_fd is not -1, then tb is not NULL */
|
||||
force_assert(-1 == hctx->cache_fd || NULL != tb);
|
||||
#endif
|
||||
if (-1 == hctx->cache_fd
|
||||
|| 0 == mod_deflate_cache_file_finish(r, hctx, tb)) {
|
||||
mod_deflate_note_ratio(r, hctx->bytes_out, hctx->bytes_in);
|
||||
|
|
|
@ -996,7 +996,7 @@ stat_cache_entry * stat_cache_get_entry(const buffer *name) {
|
|||
const time_t cur_ts = log_epoch_secs;
|
||||
|
||||
file_ndx = splaytree_djbhash(name->ptr, len);
|
||||
splay_tree * const sptree = sc.files = splaytree_splay(sc.files, file_ndx);
|
||||
splay_tree *sptree = sc.files = splaytree_splay(sc.files, file_ndx);
|
||||
|
||||
if (sptree && (sptree->key == file_ndx)) {
|
||||
/* we have seen this file already and
|
||||
|
@ -1060,7 +1060,7 @@ stat_cache_entry * stat_cache_get_entry(const buffer *name) {
|
|||
stat_cache_entry_free(sptree->data);
|
||||
sptree->data = sce;
|
||||
} else {
|
||||
sc.files = splaytree_insert(sptree, file_ndx, sce);
|
||||
sptree = sc.files = splaytree_insert(sptree, file_ndx, sce);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue