[prev in list] [next in list] [prev in thread] [next in thread] 

List:       uclibc-cvs
Subject:    [git commit] inet: fix unsafe access to _res.options in res_mkquery()
From:       Bernhard Reutner-Fischer <rep.dot.nop () gmail ! com>
Date:       2013-07-19 15:35:56
Message-ID: 20130719153657.3548B9A294 () busybox ! osuosl ! org
[Download RAW message or body]

commit: http://git.uclibc.org/uClibc/commit/?id=6e16f1768d75a3f5c367dcd6a5ab63f65fce5f82
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master

res_mkquery() takes out __resolv_lock to copy _res.options to function local
_res_options on line 4204, but later unsafely accesses _res.options without a
lock, instead of its local copy _res_options, on line 4221.  Looks like a
period / underscore typo.

Signed-off-by: Vanya Sergeev <vsergeev@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
---
 libc/inet/resolv.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c
index ffd3fe8..8546b27 100644
--- a/libc/inet/resolv.c
+++ b/libc/inet/resolv.c
@@ -4218,7 +4218,7 @@ int res_mkquery(int op, const char *dname, int class, int type,
 	hp = (HEADER *) buf;
 	hp->id = getpid() & 0xffff;
 	hp->opcode = op;
-	hp->rd = (_res.options & RES_RECURSE) != 0U;
+	hp->rd = (_res_options & RES_RECURSE) != 0U;
 	hp->rcode = NOERROR;
 
 	cp = buf + HFIXEDSZ;
_______________________________________________
uClibc-cvs mailing list
uClibc-cvs@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc-cvs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic