mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
fix for bug #38955
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@36615 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
02a2c4eaff
commit
891d7e0f24
3 changed files with 22 additions and 8 deletions
|
@ -1,3 +1,9 @@
|
|||
2013-05-13 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSURLConnection.m: Release delegate immediately after
|
||||
failure or succeess of communicationm (bug #38955).
|
||||
* Source/Additions/Unicode.m: Fix possible read beyond end of buf.
|
||||
|
||||
2013-04-24 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/GSMime.m: ([GSMimeParser-parse:]) fix possible infinite
|
||||
|
|
|
@ -1307,11 +1307,11 @@ tables:
|
|||
GROW();
|
||||
}
|
||||
ptr[dpos] = GSM0338_char_to_uni_table[c];
|
||||
if (c == 0x1b && spos < slen)
|
||||
if (c == 0x1b && spos < slen + 1)
|
||||
{
|
||||
unsigned i = 0;
|
||||
|
||||
c = (unc)src[spos+1];
|
||||
c = (unc)src[spos + 1];
|
||||
while (i < sizeof(GSM0338_escapes)/sizeof(GSM0338_escapes[0]))
|
||||
{
|
||||
if (GSM0338_escapes[i].to == c)
|
||||
|
|
|
@ -122,7 +122,7 @@ typedef struct
|
|||
{
|
||||
NSMutableURLRequest *_request;
|
||||
NSURLProtocol *_protocol;
|
||||
id _delegate; // Not retained
|
||||
id _delegate;
|
||||
BOOL _debug;
|
||||
} Internal;
|
||||
|
||||
|
@ -222,7 +222,7 @@ typedef struct
|
|||
}
|
||||
|
||||
/* According to bug #35686, Cocoa has a bizarre deviation from the
|
||||
* convention that delegates are not retained here.
|
||||
* convention that delegates are retained here.
|
||||
* For compatibility we retain the delegate and release it again
|
||||
* when the operation is over.
|
||||
*/
|
||||
|
@ -319,7 +319,6 @@ typedef struct
|
|||
|
||||
collector = [_NSURLConnectionDataCollector new];
|
||||
conn = [[self alloc] initWithRequest: request delegate: collector];
|
||||
[collector release]; // retained by connection
|
||||
if (nil != conn)
|
||||
{
|
||||
NSRunLoop *loop;
|
||||
|
@ -345,6 +344,7 @@ typedef struct
|
|||
}
|
||||
[conn release];
|
||||
}
|
||||
[collector release];
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
@ -363,7 +363,11 @@ typedef struct
|
|||
- (void) URLProtocol: (NSURLProtocol *)protocol
|
||||
didFailWithError: (NSError *)error
|
||||
{
|
||||
[this->_delegate connection: self didFailWithError: error];
|
||||
id o = this->_delegate;
|
||||
|
||||
this->_delegate = nil;
|
||||
[o connection: self didFailWithError: error];
|
||||
DESTROY(o);
|
||||
}
|
||||
|
||||
- (void) URLProtocol: (NSURLProtocol *)protocol
|
||||
|
@ -438,14 +442,18 @@ typedef struct
|
|||
|
||||
- (void) URLProtocolDidFinishLoading: (NSURLProtocol *)protocol
|
||||
{
|
||||
[this->_delegate connectionDidFinishLoading: self];
|
||||
id o = this->_delegate;
|
||||
|
||||
this->_delegate = nil;
|
||||
[o connectionDidFinishLoading: self];
|
||||
DESTROY(o);
|
||||
}
|
||||
|
||||
- (void) URLProtocol: (NSURLProtocol *)protocol
|
||||
didCancelAuthenticationChallenge: (NSURLAuthenticationChallenge *)challenge
|
||||
{
|
||||
[this->_delegate connection: self
|
||||
didCancelAuthenticationChallenge: challenge];
|
||||
didCancelAuthenticationChallenge: challenge];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
Loading…
Reference in a new issue