Skip to content

Commit

Permalink
worker: avoid uninitialized pointers
Browse files Browse the repository at this point in the history
The cookie module could segfault due to the `opt` pointer not being
initialized when no EDNS was sent in the incoming request.
  • Loading branch information
vcunat committed Oct 19, 2016
1 parent 9eacf66 commit 3a4f655
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions daemon/worker.c
Expand Up @@ -259,6 +259,8 @@ static struct qr_task *qr_task_create(struct worker_ctx *worker, uv_handle_t *ha
task->req.qsource.key = NULL;
task->req.qsource.addr = NULL;
task->req.qsource.dst_addr = NULL;
task->req.qsource.packet = NULL;
task->req.qsource.opt = NULL;
/* Remember query source addr */
if (addr) {
size_t addr_len = sizeof(struct sockaddr_in);
Expand Down

0 comments on commit 3a4f655

Please sign in to comment.