dns_send_question was ocassionally called with a name from name_buf
Signed-off-by: Steven Barth <steven@midlink.org>
#include "interface.h"
static char name_buffer[MAX_NAME_LEN + 1];
#include "interface.h"
static char name_buffer[MAX_NAME_LEN + 1];
+static char dns_buffer[MAX_NAME_LEN];
static struct blob_buf ans_buf;
const char*
static struct blob_buf ans_buf;
const char*
.iov_len = sizeof(h),
},
{
.iov_len = sizeof(h),
},
{
- .iov_base = name_buffer,
+ .iov_base = dns_buffer,
q.class = cpu_to_be16(((unicast) ? (CLASS_UNICAST) : (0)) | 1);
q.type = cpu_to_be16(type);
q.class = cpu_to_be16(((unicast) ? (CLASS_UNICAST) : (0)) | 1);
q.type = cpu_to_be16(type);
- len = dn_comp(question, (void *) name_buffer, sizeof(name_buffer), NULL, NULL);
+ len = dn_comp(question, (void *) dns_buffer, sizeof(dns_buffer), NULL, NULL);