You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by GitBox <gi...@apache.org> on 2018/12/06 07:03:31 UTC

[GitHub] cxfeng1 closed pull request #1871: [iOS] Fix md5 potential crash.

cxfeng1 closed pull request #1871: [iOS] Fix md5 potential crash.
URL: https://github.com/apache/incubator-weex/pull/1871
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m b/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m
index b070a87baf..2e6f9a7243 100644
--- a/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m
@@ -846,6 +846,10 @@ + (NSString *)stringWithContentsOfFile:(NSString *)filePath
 + (NSString *)md5:(NSString *)string
 {
     const char *str = string.UTF8String;
+    if (str == NULL) {
+        return nil;
+    }
+    
     unsigned char result[CC_MD5_DIGEST_LENGTH];
     CC_MD5(str, (CC_LONG)strlen(str), result);
     


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services