From: Wouter Wijngaards Date: Mon, 28 Jan 2008 09:31:29 +0000 (+0000) Subject: Two small fixes. X-Git-Tag: release-0.9~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=193892e52dfb76c65e79c24aa79bcce22abdeda2;p=thirdparty%2Funbound.git Two small fixes. git-svn-id: file:///svn/unbound/trunk@905 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/doc/Changelog b/doc/Changelog index f4fcc428e..faa2f2b03 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,9 @@ +28 January 2008: Wouter + - fixup uninit use of buffer by libunbound (query id, flags) for + local_zone answers. + - fixup uninit warning from random.c; also seems to fix sporadic + sigFPE coming out of openssl. + 25 January 2008: Wouter - added tpkg for asynclook and library use. - allows localhost to be queried when as a library. diff --git a/libunbound/worker.c b/libunbound/worker.c index 78bb1c496..3b0f5b952 100644 --- a/libunbound/worker.c +++ b/libunbound/worker.c @@ -511,6 +511,8 @@ int libworker_fg(struct ub_val_ctx* ctx, struct ctx_query* q) qflags = BIT_RD; q->w = w; /* see if there is a fixed answer */ + ldns_buffer_write_u16_at(w->back->udp_buff, 0, qid); + ldns_buffer_write_u16_at(w->back->udp_buff, 2, qflags); if(local_zones_answer(ctx->local_zones, &qinfo, &edns, w->back->udp_buff, w->env->scratch)) { libworker_fg_done_cb(q, LDNS_RCODE_NOERROR, @@ -635,6 +637,8 @@ handle_newq(struct libworker* w, uint8_t* buf, uint32_t len) qid = 0; qflags = BIT_RD; /* see if there is a fixed answer */ + ldns_buffer_write_u16_at(w->back->udp_buff, 0, qid); + ldns_buffer_write_u16_at(w->back->udp_buff, 2, qflags); if(local_zones_answer(w->ctx->local_zones, &qinfo, &edns, w->back->udp_buff, w->env->scratch)) { q->msg_security = sec_status_insecure; diff --git a/util/random.c b/util/random.c index 7c0e5a6f8..812148b58 100644 --- a/util/random.c +++ b/util/random.c @@ -74,6 +74,7 @@ ub_arc4random_stir(struct ub_hiddenstate* s) int i; memset(&s->rc4, 0, sizeof(s->rc4)); + memset(rand_buf, 0xc, sizeof(rand_buf)); if (RAND_bytes(rand_buf, (int)sizeof(rand_buf)) <= 0) fatal_exit("Couldn't obtain random bytes (error %ld)", ERR_get_error());