bryancall opened a new pull request, #13734:
URL: https://github.com/apache/trafficserver/pull/13734
### What this is
Two one-word initializers. Neither defect is reachable, so this silences two
false positives rather than fixing a read of an indeterminate value. Both are
worth taking because each matches how the same code is already written
elsewhere in the tree.
### CID 1533658 — `plugins/background_fetch/configs.cc`
```c
- BgFetchRule::size_cmp_type::OP op;
+ BgFetchRule::size_cmp_type::OP
op{BgFetchRule::size_cmp_type::LESS_THAN_OR_EQUAL};
```
Every path that reaches the use of `op` assigns it: the `else` branch of the
three-way condition calls `TSError()` and `continue`s, so there is no route
from the declaration to `_rules.emplace_back()` that skips an assignment. The
analyzer cannot prove the chain is exhaustive.
Worth noting why this one never closed. Coverity merged the two copies of
`BgFetchConfig::readConfig` under a single CID, and both
[#12974](https://github.com/apache/trafficserver/pull/12974) and
[#13004](https://github.com/apache/trafficserver/pull/13004) cited it while
only touching the `cache_fill` copy, which already carries the initializer.
### CID 1645841 — `src/proxy/http/remap/RemapYamlConfig.cc`
```c
- struct dirent **entrylist;
+ struct dirent **entrylist = nullptr;
```
`entrylist` is only read after `scandir()` returns a non-negative count, and
POSIX stores the array on success, so the `free()` in `free_directory_list()`
is safe. The legacy `remap.config` loop this was ported from, in
`RemapConfig.cc`, initializes it to `nullptr`; the YAML port dropped that.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]