Skip to content

Commit

Permalink
Fix AFURLSessionManager security weakness
Browse files Browse the repository at this point in the history
crashes when calling to a released block pointer
  • Loading branch information
BKKim authored and BKKim committed May 30, 2017
1 parent 4f3c694 commit f8159fe
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions AFNetworking/AFURLSessionManager.m
Expand Up @@ -39,13 +39,18 @@ static dispatch_queue_t url_session_manager_creation_queue() {
}

static void url_session_manager_create_task_safely(dispatch_block_t block) {
if (NSFoundationVersionNumber < NSFoundationVersionNumber_With_Fixed_5871104061079552_bug) {
// Fix of bug
// Open Radar:http://openradar.appspot.com/radar?id=5871104061079552 (status: Fixed in iOS8)
// Issue about:https://github.com/AFNetworking/AFNetworking/issues/2093
dispatch_sync(url_session_manager_creation_queue(), block);

if(block != nil) {
if (NSFoundationVersionNumber < NSFoundationVersionNumber_With_Fixed_5871104061079552_bug) {
// Fix of bug
// Open Radar:http://openradar.appspot.com/radar?id=5871104061079552 (status: Fixed in iOS8)
// Issue about:https://github.com/AFNetworking/AFNetworking/issues/2093
dispatch_sync(url_session_manager_creation_queue(), block);
} else {
block();
}
} else {
block();
return;
}
}

Expand Down

0 comments on commit f8159fe

Please sign in to comment.