public inbox for ecos-patches@sourceware.org
 help / color / mirror / Atom feed
* Spurious mutex unlock in getaddrinfo()
@ 2010-09-29  9:52 Kelvin Lawson
  2010-09-29 10:46 ` John Dallaway
  0 siblings, 1 reply; 2+ messages in thread
From: Kelvin Lawson @ 2010-09-29  9:52 UTC (permalink / raw)
  To: ecos-patches

[-- Attachment #1: Type: text/plain, Size: 245 bytes --]

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.

[-- Attachment #2: dns.patch --]
[-- Type: text/x-patch, Size: 1279 bytes --]

# 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;
         }

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Spurious mutex unlock in getaddrinfo()
  2010-09-29  9:52 Spurious mutex unlock in getaddrinfo() Kelvin Lawson
@ 2010-09-29 10:46 ` John Dallaway
  0 siblings, 0 replies; 2+ messages in thread
From: John Dallaway @ 2010-09-29 10:46 UTC (permalink / raw)
  To: Kelvin Lawson; +Cc: ecos-patches

Hi Kelvin

Kelvin Lawson wrote:

> 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.

Thank you for the patch. Checked-in.

John Dallaway
eCos maintainer

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-09-29 10:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-29  9:52 Spurious mutex unlock in getaddrinfo() Kelvin Lawson
2010-09-29 10:46 ` John Dallaway

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).