diff options
author | Glenn Strauss <gstrauss@gluelogic.com> | 2021-04-07 01:06:39 -0400 |
---|---|---|
committer | Glenn Strauss <gstrauss@gluelogic.com> | 2021-04-07 01:06:55 -0400 |
commit | f13752f3da70021c0c74e679f22b3f41aa79b5d1 (patch) | |
tree | 7c746418643b043c93048048106c5ed190228c81 /src/mod_dirlisting.c | |
parent | fccf2b768cef5183e6f7341e9f36f137c0d0b747 (diff) | |
download | lighttpd-git-f13752f3da70021c0c74e679f22b3f41aa79b5d1.tar.gz |
[multiple] quiet coverity warnings
includes rejigger of some code in buffer.c for Coverity to have better
visibility into what is happening in internal, private funcs
Diffstat (limited to 'src/mod_dirlisting.c')
-rw-r--r-- | src/mod_dirlisting.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mod_dirlisting.c b/src/mod_dirlisting.c index 2efe77e5..de6b9c0a 100644 --- a/src/mod_dirlisting.c +++ b/src/mod_dirlisting.c @@ -224,12 +224,25 @@ static pcre_keyvalue_buffer * mod_dirlisting_parse_excludes(server *srv, const a return kvb; } +#ifdef __COVERITY__ +#include "burl.h" +#endif + static int mod_dirlisting_exclude(pcre_keyvalue_buffer * const kvb, const char * const name, const uint32_t len) { /*(re-use keyvalue.[ch] for match-only; * must have been configured with empty kvb 'value' during init)*/ buffer input = { NULL, len+1, 0 }; *(const char **)&input.ptr = name; pcre_keyvalue_ctx ctx = { NULL, NULL, 0, -1 }; + #ifdef __COVERITY__ + /*(again, must have been configured w/ empty kvb 'value' during init)*/ + struct cond_match_t cache; + memset(&cache, 0, sizeof(cache)); + struct burl_parts_t bp; + memset(&bp, 0, sizeof(bp)); + ctx.cache = &cache; + ctx.burl = &bp; + #endif /*(fail closed (simulate match to exclude) if there is an error)*/ return HANDLER_ERROR == pcre_keyvalue_buffer_process(kvb,&ctx,&input,NULL) || -1 != ctx.m; |