summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2010-09-24 20:42:31 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2010-09-24 20:42:31 +0200
commit6589d555200e06835d5a8eb38fb87dc1b9ae6bf1 (patch)
tree2c5475509bff3b3af4125d4581298ca6f4bf5755 /plugins
parent4990defa7cdf73d79660a12af31620f67a2ddbf1 (diff)
downloadconnman-6589d555200e06835d5a8eb38fb87dc1b9ae6bf1.tar.gz
connman-6589d555200e06835d5a8eb38fb87dc1b9ae6bf1.tar.bz2
connman-6589d555200e06835d5a8eb38fb87dc1b9ae6bf1.zip
Do not access the DNS request buffer if it's NULL
Diffstat (limited to 'plugins')
-rw-r--r--plugins/dnsproxy.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/dnsproxy.c b/plugins/dnsproxy.c
index 63c88b98..ac184900 100644
--- a/plugins/dnsproxy.c
+++ b/plugins/dnsproxy.c
@@ -482,11 +482,14 @@ static gboolean tcp_server_event(GIOChannel *channel, GIOCondition condition,
for (list = request_list; list; list = list->next) {
struct request_data *req = list->data;
- struct domain_hdr *hdr = (void *) (req->request + 2);
+ struct domain_hdr *hdr;
if (req->protocol == IPPROTO_UDP)
continue;
+ if (req->request == NULL)
+ continue;
+
/*
* If we're not waiting for any further response
* from another name server, then we send an error
@@ -495,6 +498,7 @@ static gboolean tcp_server_event(GIOChannel *channel, GIOCondition condition,
if (req->numserv && --(req->numserv))
continue;
+ hdr = (void *) (req->request + 2);
hdr->id = req->srcid;
send_response(req->client_sk, req->request,
req->request_len, NULL, 0, IPPROTO_TCP);