This is the mail archive of the ecos-patches@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Spurious mutex unlock in getaddrinfo()


Attached a patch to fix an issue in the bad parameter handling of
getaddrinfo(). If the name lookup exceeds the maximum length then it
unlocks a mutex which it does not own. The mutex is not locked until
further down the same function.

Kelvin.
# HG changeset patch
# User Kelvin Lawson <kelvinl@users.sf.net>
# Date 1285753346 -3600
# Node ID 0ba504b6662ab6b15aa37246eb7b3d335b7b48f6
# Parent  a98ace8abb52e0d4c6f494e86f7b406643bb9126
cyg_res_getaddrinfo: Remove spurious mutex unlock when name lookup string is too long.

diff -r a98ace8abb52 -r 0ba504b6662a packages/net/ns/dns/current/ChangeLog
--- a/packages/net/ns/dns/current/ChangeLog	Sat Sep 18 16:10:32 2010 +0000
+++ b/packages/net/ns/dns/current/ChangeLog	Wed Sep 29 10:42:26 2010 +0100
@@ -1,3 +1,8 @@
+2010-09-29  Kelvin Lawson  <kelvinl@users.sf.net>
+
+	* src/dns.c: Remove spurious mutex unlock in cyg_res_getaddrinfo()
+	when name lookup string is too long.
+
 2008-08-12  Jonathan Larmour  <jifl@eCosCentric.com>
 
 	* src/dns.c: id global should be unsigned, in line with DNS header.
diff -r a98ace8abb52 -r 0ba504b6662a packages/net/ns/dns/current/src/dns.c
--- a/packages/net/ns/dns/current/src/dns.c	Sat Sep 18 16:10:32 2010 +0000
+++ b/packages/net/ns/dns/current/src/dns.c	Wed Sep 29 10:42:26 2010 +0100
@@ -593,7 +593,6 @@
     
     if (domainname) {
         if ((strlen(hostname) + strlen(domainname)) > 254) {
-            cyg_drv_mutex_unlock(&dns_mutex);
             CYG_REPORT_RETVAL( -EAI_FAIL );
             return -EAI_FAIL;
         }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]