From 23f68cd57fbdfa4705c6c7dd261bc602b570ee62 Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Sat, 21 Mar 2009 09:04:02 +0000 Subject: [PATCH] fix for possible error when receiving out of bad data git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28108 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 7 +++++++ Source/NSMessagePort.m | 4 ++-- Source/NSSocketPort.m | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 47e627ff5..82c3ce684 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-03-21 Richard Frith-Macdonald + + * Source/NSMessagePort.m: + * Source/NSSocketPort.m: + Fix to treat exceptional (out of band) event as meaning a readable + rather than a writable descriptor. + 2009-03-20 Richard Frith-Macdonald * Source/NSURLCredential.m: diff --git a/Source/NSMessagePort.m b/Source/NSMessagePort.m index 01764aed0..731c66310 100644 --- a/Source/NSMessagePort.m +++ b/Source/NSMessagePort.m @@ -536,7 +536,7 @@ static Class runLoopClass; { NSDebugMLLog(@"NSMessagePort_details", @"received %s event on 0x%x", - type == ET_RPORT ? "read" : "write", self); + type != ET_WDESC ? "read" : "write", self); /* * If we have been invalidated (desc < 0) then we should ignore this * event and remove ourself from the runloop. @@ -558,7 +558,7 @@ static Class runLoopClass; M_LOCK(myLock); - if (type == ET_RPORT) + if (type != ET_WDESC) { unsigned want; void *bytes; diff --git a/Source/NSSocketPort.m b/Source/NSSocketPort.m index 4ccb93524..5bc7cb997 100644 --- a/Source/NSSocketPort.m +++ b/Source/NSSocketPort.m @@ -1229,7 +1229,7 @@ static Class runLoopClass; WSANETWORKEVENTS ocurredEvents; #endif NSDebugMLLog(@"GSTcpHandle", @"received %s event on 0x%x", - type == ET_RPORT ? "read" : "write", self); + type != ET_WDESC ? "read" : "write", self); /* * If we have been invalidated (desc < 0) then we should ignore this * event and remove ourself from the runloop. @@ -1326,7 +1326,7 @@ static Class runLoopClass; abort(); } #else - if (type == ET_RPORT) + if (type != ET_WDESC) { [self receivedEventRead]; }