projects
/
platform
/
upstream
/
connman.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c23ecc1
)
dnsproxy: Make sure "rr" is not NULL
author
Arjan van de Ven
<arjan@linux.intel.com>
Tue, 10 Jan 2012 00:08:21 +0000
(16:08 -0800)
committer
Daniel Wagner
<daniel.wagner@bmw-carit.de>
Tue, 10 Jan 2012 12:43:57 +0000
(13:43 +0100)
I've caught some crashes with connman where "rr" ended up being NULL;
easy to add a check for this and prevent the crash.
src/dnsproxy.c
patch
|
blob
|
history
diff --git
a/src/dnsproxy.c
b/src/dnsproxy.c
index
f3fc30f
..
cdc5b11
100644
(file)
--- a/
src/dnsproxy.c
+++ b/
src/dnsproxy.c
@@
-579,6
+579,9
@@
static int parse_rr(unsigned char *buf, unsigned char *start,
rr = (void *) (*end);
+ if (rr == NULL)
+ return -EINVAL;
+
*type = ntohs(rr->type);
*class = ntohs(rr->class);
*ttl = ntohl(rr->ttl);