diff --git a/daemon/unbound.c b/daemon/unbound.c index dec337c02..28ea17355 100644 --- a/daemon/unbound.c +++ b/daemon/unbound.c @@ -521,7 +521,7 @@ perform_setup(struct daemon* daemon, struct config_file* cfg, int debug_mode, /* setusercontext does initgroups, setuid, setgid, and * also resource limits from login config, but we * still call setresuid, setresgid to be sure to set all uid*/ - if(setusercontext(NULL, pwd, uid, + if(setusercontext(NULL, pwd, uid, (unsigned) LOGIN_SETALL & ~LOGIN_SETUSER & ~LOGIN_SETGROUP) != 0) log_warn("unable to setusercontext %s: %s", cfg->username, strerror(errno)); diff --git a/doc/Changelog b/doc/Changelog index 4227e44ac..4d75e0377 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,5 +1,6 @@ 22 Aug 2013: Wouter - more fixes that I overlooked. + - review fixes from Willem. 21 Aug 2013: Wouter - Fix#520: Errors found by static analysis from Tomas Hozza(redhat). diff --git a/services/mesh.c b/services/mesh.c index d6249f9c5..a8cb115ab 100644 --- a/services/mesh.c +++ b/services/mesh.c @@ -321,6 +321,8 @@ void mesh_new_client(struct mesh_area* mesh, struct query_info* qinfo, } #ifdef UNBOUND_DEBUG n = +#else + (void) #endif rbtree_insert(&mesh->all, &s->node); log_assert(n != NULL); @@ -390,6 +392,8 @@ mesh_new_callback(struct mesh_area* mesh, struct query_info* qinfo, } #ifdef UNBOUND_DEBUG n = +#else + (void) #endif rbtree_insert(&mesh->all, &s->node); log_assert(n != NULL); @@ -450,6 +454,8 @@ void mesh_new_prefetch(struct mesh_area* mesh, struct query_info* qinfo, } #ifdef UNBOUND_DEBUG n = +#else + (void) #endif rbtree_insert(&mesh->all, &s->node); log_assert(n != NULL); @@ -657,6 +663,8 @@ void mesh_detach_subs(struct module_qstate* qstate) RBTREE_FOR(ref, struct mesh_state_ref*, &qstate->mesh_info->sub_set) { #ifdef UNBOUND_DEBUG n = +#else + (void) #endif rbtree_delete(&ref->s->super_set, &lookup); log_assert(n != NULL); /* must have been present */ @@ -693,6 +701,8 @@ int mesh_attach_sub(struct module_qstate* qstate, struct query_info* qinfo, } #ifdef UNBOUND_DEBUG n = +#else + (void) #endif rbtree_insert(&mesh->all, &sub->node); log_assert(n != NULL); @@ -701,6 +711,8 @@ int mesh_attach_sub(struct module_qstate* qstate, struct query_info* qinfo, /* set new query state to run */ #ifdef UNBOUND_DEBUG n = +#else + (void) #endif rbtree_insert(&mesh->run, &sub->run_node); log_assert(n != NULL); @@ -749,6 +761,8 @@ int mesh_state_attachment(struct mesh_state* super, struct mesh_state* sub) } #ifdef UNBOUND_DEBUG n = +#else + (void) #endif rbtree_insert(&super->sub_set, &subref->node); log_assert(n != NULL); /* we checked above if statement, the reverse diff --git a/services/outside_network.c b/services/outside_network.c index b99a933aa..373d8f353 100644 --- a/services/outside_network.c +++ b/services/outside_network.c @@ -1210,6 +1210,8 @@ serviced_create(struct outside_network* outnet, ldns_buffer* buff, int dnssec, sq->to_be_deleted = 0; #ifdef UNBOUND_DEBUG ins = +#else + (void) #endif rbtree_insert(outnet->serviced, &sq->node); log_assert(ins != NULL); /* must not be already present */ @@ -1449,6 +1451,8 @@ serviced_callbacks(struct serviced_query* sq, int error, struct comm_point* c, size_t backlen = 0; #ifdef UNBOUND_DEBUG rbnode_t* rem = +#else + (void) #endif /* remove from tree, and schedule for deletion, so that callbacks * can safely deregister themselves and even create new serviced @@ -1866,6 +1870,8 @@ void outnet_serviced_query_stop(struct serviced_query* sq, void* cb_arg) if(!sq->cblist && !sq->to_be_deleted) { #ifdef UNBOUND_DEBUG rbnode_t* rem = +#else + (void) #endif rbtree_delete(sq->outnet->serviced, sq); log_assert(rem); /* should be present */ diff --git a/util/storage/lookup3.c b/util/storage/lookup3.c index 3f8c8f357..7596033bd 100644 --- a/util/storage/lookup3.c +++ b/util/storage/lookup3.c @@ -64,7 +64,7 @@ on 1 byte), but shoehorning those bytes into integers efficiently is messy. #endif /* random initial value */ -static uint32_t raninit = 0xdeadbeef; +static uint32_t raninit = (uint32_t)0xdeadbeef; void hash_set_raninit(uint32_t v) diff --git a/validator/autotrust.c b/validator/autotrust.c index 5c362ac11..362f57a85 100644 --- a/validator/autotrust.c +++ b/validator/autotrust.c @@ -881,6 +881,8 @@ print_id(FILE* out, char* fname, struct module_env* env, ldns_buffer_clear(env->scratch_buffer); #ifdef UNBOUND_DEBUG s = +#else + (void) #endif ldns_rdf2buffer_str_dname(env->scratch_buffer, &rdf); log_assert(s == LDNS_STATUS_OK); diff --git a/validator/val_anchor.c b/validator/val_anchor.c index 36d3365a9..e710f2f24 100644 --- a/validator/val_anchor.c +++ b/validator/val_anchor.c @@ -242,6 +242,8 @@ anchor_new_ta(struct val_anchors* anchors, uint8_t* name, int namelabs, } #ifdef UNBOUND_DEBUG r = +#else + (void) #endif rbtree_insert(anchors->tree, &ta->node); if(lockit) { diff --git a/validator/val_nsec3.c b/validator/val_nsec3.c index 4b48e7bee..20580c0d7 100644 --- a/validator/val_nsec3.c +++ b/validator/val_nsec3.c @@ -713,6 +713,8 @@ nsec3_hash_name(rbtree_t* table, struct regional* region, ldns_buffer* buf, return r; #ifdef UNBOUND_DEBUG n = +#else + (void) #endif rbtree_insert(table, &c->node); log_assert(n); /* cannot be duplicate, just did lookup */