mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
don't copy address info ifg getpeername fails
This commit is contained in:
parent
4f50f358c3
commit
890eaa9d32
1 changed files with 5 additions and 3 deletions
|
@ -2094,10 +2094,12 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
h = [[[self class] alloc] initWithFileDescriptor: desc
|
||||
closeOnDealloc: YES];
|
||||
h->isSocket = YES;
|
||||
getpeername(desc, &sin, &size);
|
||||
[h setAddr: &sin];
|
||||
if (getpeername(desc, &sin, &size) >= 0)
|
||||
{
|
||||
[h setAddr: &sin];
|
||||
}
|
||||
[readInfo setObject: h
|
||||
forKey: NSFileHandleNotificationFileHandleItem];
|
||||
forKey: NSFileHandleNotificationFileHandleItem];
|
||||
RELEASE(h);
|
||||
}
|
||||
[self postReadNotification];
|
||||
|
|
Loading…
Reference in a new issue