2008-05-06 Anders Carlsson <andersca@apple.com>
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 May 2008 18:16:30 +0000 (18:16 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 May 2008 18:16:30 +0000 (18:16 +0000)
        Fix typo (don't read random memory).

        * Plugins/WebBasePluginPackage.m:
        (-[WebBasePluginPackage isNativeLibraryData:]):

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

WebKit/mac/ChangeLog
WebKit/mac/Plugins/WebBasePluginPackage.m

index cef983b..a55a81e 100644 (file)
@@ -1,3 +1,10 @@
+2008-05-06  Anders Carlsson  <andersca@apple.com>
+
+        Fix typo (don't read random memory).
+        
+        * Plugins/WebBasePluginPackage.m:
+        (-[WebBasePluginPackage isNativeLibraryData:]):
+
 2008-05-05  Anders Carlsson  <andersca@apple.com>
 
         Reviewed by Darin.
index d2ff85c..8536c56 100644 (file)
@@ -451,8 +451,8 @@ static inline void swapIntsInHeader(uint8_t* bytes, unsigned length)
             if (magic == FAT_CIGAM)
                 swapIntsInHeader(bytes.data(), bytes.size());
             
-            archs = (struct fat_arch*)(bytes.size() + sizeof(struct fat_header));            
-            numArchs = ((struct fat_header *)bytes.size())->nfat_arch;
+            archs = (struct fat_arch*)(bytes.data() + sizeof(struct fat_header));            
+            numArchs = ((struct fat_header *)bytes.data())->nfat_arch;
             
             unsigned maxArchs = (bytes.size() - sizeof(struct fat_header)) / sizeof(struct fat_arch);
             if (numArchs > maxArchs)