Permalink
Browse files

Add some security around wrongly typed URL argument

  • Loading branch information...
1 parent 5f27d2d commit 40524876e9a66fa6dbf0eb6980cd98071a9d7923 @rs committed Sep 6, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 SDWebImage/SDWebImageManager.m
@@ -123,6 +123,10 @@ - (void)downloadWithURL:(NSURL *)url delegate:(id<SDWebImageManagerDelegate>)del
{
url = [NSURL URLWithString:(NSString *)url];
}
+ else if (![url isKindOfClass:NSURL.class])
+ {
+ url = nil; // Prevent some common crashes due to common wrong values passed like NSNull.null for instance
+ }
if (!url || !delegate || (!(options & SDWebImageRetryFailed) && [failedURLs containsObject:url]))
{

0 comments on commit 4052487

Please sign in to comment.