thread->master = m;
thread->arg = arg;
thread->yield = EVENT_YIELD_TIME_SLOT; /* default */
- thread->ref = NULL;
+ /* thread->ref is zeroed either by XCALLOC above or by memset before
+ * being put on the "unuse" list by thread_add_unuse().
+ * Setting it here again makes coverity complain about a missing
+ * lock :(
+ */
+ /* thread->ref = NULL; */
thread->ignore_timer_late = false;
/*
enum ipaddr_type_t ipa_type;
union {
uint8_t addr;
+ uint8_t addrbytes[16];
struct in_addr _v4_addr;
struct in6_addr _v6_addr;
} ip;
size_t nmodules, bool db_enabled)
{
struct yang_module *loaded[nmodules], **loadedp = loaded;
- bool explicit_compile;
/*
* Currently using this explicit compile feature in libyang2 leads to
* of modules until they have all been loaded into the context. This
* avoids multiple recompiles of the same modules as they are
* imported/augmented etc.
+ * (Done as a #define to make coverity happy)
*/
- explicit_compile = false;
+#define explicit_compile false
nb_db_enabled = db_enabled;
return 0;
prefixlen = evp->prefix.prefix_addr.ip_prefix_length;
- np = &evp->prefix.prefix_addr.ip.ip.addr;
+ np = evp->prefix.prefix_addr.ip.ip.addrbytes;
/* If n's prefix is longer than p's one return 0. */
if (prefixlen > p->prefixlen)
{
size_t copylen = len;
- if (!iop->cb)
+ if (!iop->cb || !len)
return 0;
if (iop->avail < copylen)
copylen = iop->avail;
void PBKDF2_SHA256(const uint8_t *passwd, size_t passwdlen, const uint8_t *salt,
size_t saltlen, uint64_t c, uint8_t *buf, size_t dkLen)
{
- HMAC_SHA256_CTX PShctx, hctx;
+ HMAC_SHA256_CTX PShctx = {}, hctx;
size_t i;
uint8_t ivec[4];
uint8_t U[32];
printf("result: %d\n", ret);
printf("vtysh node: %d\n", vty->node);
#endif /* VTYSH_DEBUG */
-
- if (vty->pass_fd != -1) {
+ if (vty->pass_fd >= 0) {
memset(vty->pass_fd_status, 0, 4);
vty->pass_fd_status[3] = ret;
vty->status = VTY_PASSFD;
* => skip vty_event(VTYSH_READ, vty)!
*/
return;
- }
+ } else
+ /* normalize other invalid values */
+ vty->pass_fd = -1;
/* hack for asynchronous "write integrated"
* - other commands in "buf" will be ditched