]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Two small fixes.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Mon, 28 Jan 2008 09:31:29 +0000 (09:31 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Mon, 28 Jan 2008 09:31:29 +0000 (09:31 +0000)
git-svn-id: file:///svn/unbound/trunk@905 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
libunbound/worker.c
util/random.c

index f4fcc428e1830dcdad8d301f7ad731eddcf1da9c..faa2f2b0371227f5ced7d8f6426f41f485eb5187 100644 (file)
@@ -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.
index 78bb1c496ef1fe16561ccca577ef34ed67e3e215..3b0f5b952eec02d3bb630fdf2b0487f653036154 100644 (file)
@@ -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;
index 7c0e5a6f88d26df029f097dcc6b04a6243226b60..812148b5880d97d461124c98c8f00aa1b423eb46 100644 (file)
@@ -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());