Fixed: <rdar://problem/3782543> CrashTracer: ...87 crashes at com.apple.WebKit:...
authorcblu <cblu@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 4 Sep 2004 00:04:26 +0000 (00:04 +0000)
committercblu <cblu@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 4 Sep 2004 00:04:26 +0000 (00:04 +0000)
        Reviewed by john.

        * Plugins.subproj/WebNetscapePluginPackage.m:
        (-[WebNetscapePluginPackage initWithPath:]): make sure the file is at least 8 bytes long before calling memcmp

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@7453 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit/ChangeLog
WebKit/Plugins.subproj/WebNetscapePluginPackage.m

index eebf906f79927a9796f700c1284a7a3c8fa41a77..9e1e70a37bc1ac91356bb8a90f996ef2372d3afa 100644 (file)
@@ -1,3 +1,12 @@
+2004-09-03  Chris Blumenberg  <cblu@apple.com>
+
+       Fixed: <rdar://problem/3782543> CrashTracer: ...87 crashes at com.apple.WebKit: -[WebNetscapePluginPackage initWithPath:] + 0x18c
+
+        Reviewed by john.
+
+        * Plugins.subproj/WebNetscapePluginPackage.m:
+        (-[WebNetscapePluginPackage initWithPath:]): make sure the file is at least 8 bytes long before calling memcmp
+
 2004-09-03  Chris Blumenberg  <cblu@apple.com>
        
        Fixed:
index 7bde7863225bc0641324a92111f07a33308925f8..32de6abc1843291a52cbd8abee628d6891a9c5dd 100644 (file)
@@ -263,7 +263,8 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
         [executableURL release];
         NSData *data = [executableFile readDataOfLength:8];
         [executableFile closeFile];
-        if (!data) {
+        // Check the length of the data before calling memcmp. We think this fixes 3782543.
+        if (data == nil || [data length] < 8) {
             [self release];
             return nil;
         }