Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add some security around wrongly typed URL argument

  • Loading branch information...
commit 40524876e9a66fa6dbf0eb6980cd98071a9d7923 1 parent 5f27d2d
@rs authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 SDWebImage/SDWebImageManager.m
View
4 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]))
{
Please sign in to comment.
Something went wrong with that request. Please try again.