[webkit-changes] cvs commit: WebKit/Plugins.subproj WebNetscapePluginPackage.m

Adele adele at opensource.apple.com
Thu Jul 14 11:05:02 PDT 2005


adele       05/07/14 11:05:01

  Modified:    .        Tag: gcc-4-0-branch ChangeLog
               Plugins.subproj Tag: gcc-4-0-branch
                        WebNetscapePluginPackage.m
  Log:
          Merged fix for:
          <rdar://problem/4127100> [WebKit] 8B1016: After installing Acrobat Reader, can no longer see pdf's in Safari
  
          * Plugins.subproj/WebNetscapePluginPackage.m:
          (-[WebNetscapePluginPackage initWithPath:]):
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.3118.6.7 +8 -0      WebKit/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebKit/ChangeLog,v
  retrieving revision 1.3118.6.6
  retrieving revision 1.3118.6.7
  diff -u -r1.3118.6.6 -r1.3118.6.7
  --- ChangeLog	14 Jul 2005 17:55:26 -0000	1.3118.6.6
  +++ ChangeLog	14 Jul 2005 18:04:57 -0000	1.3118.6.7
  @@ -1,6 +1,14 @@
   2005-07-14  Adele Peterson  <adele at apple.com>
   
           Merged fix for:
  +        <rdar://problem/4127100> [WebKit] 8B1016: After installing Acrobat Reader, can no longer see pdf's in Safari
  +
  +        * Plugins.subproj/WebNetscapePluginPackage.m:
  +        (-[WebNetscapePluginPackage initWithPath:]):
  +
  +2005-07-14  Adele Peterson  <adele at apple.com>
  +
  +        Merged fix for:
           <rdar://problem/4125127> [WebKit] horizontal rulers don't render on Safari on web.apple.com
   
           * WebCoreSupport.subproj/WebImageData.m:
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.40.10.1 +26 -1     WebKit/Plugins.subproj/WebNetscapePluginPackage.m
  
  Index: WebNetscapePluginPackage.m
  ===================================================================
  RCS file: /cvs/root/WebKit/Plugins.subproj/WebNetscapePluginPackage.m,v
  retrieving revision 1.40
  retrieving revision 1.40.10.1
  diff -u -r1.40 -r1.40.10.1
  --- WebNetscapePluginPackage.m	14 Jan 2005 01:01:03 -0000	1.40
  +++ WebNetscapePluginPackage.m	14 Jul 2005 18:05:01 -0000	1.40.10.1
  @@ -12,6 +12,8 @@
   #import <JavaScriptCore/npruntime_impl.h>
   
   #import <Foundation/NSPrivateDecls.h>
  +#import <mach-o/arch.h>
  +#import <mach-o/loader.h>
   
   typedef void (* FunctionPointer) (void);
   typedef void (* TransitionVector) (void);
  @@ -200,7 +202,7 @@
       // Check if the executable is Mach-O or CFM.
       if (bundle) {
           NSFileHandle *executableFile = [NSFileHandle fileHandleForReadingAtPath:[bundle executablePath]];
  -        NSData *data = [executableFile readDataOfLength:8];
  +        NSData *data = [executableFile readDataOfLength:512];
           [executableFile closeFile];
           // Check the length of the data before calling memcmp. We think this fixes 3782543.
           if (data == nil || [data length] < 8) {
  @@ -215,6 +217,29 @@
               return nil;
           }
   #endif
  +
  +#if __i386__		
  +		// If we have a 32-bit thin Mach-O file, see if we have an i386 binary.  If not, don't load it.
  +		// This is designed to be the safest possible test for now.  We'll only reject files that we
  +		// can easily tell are wrong.
  +		if ([data length] >= sizeof(struct mach_header)) {
  +		    int isNative = 1;	// Default to yes so we default to our previous behavior of accepting everything
  +		    struct mach_header *header;
  +		    const NXArchInfo *localArch = NXGetLocalArchInfo();
  +		    if (localArch != NULL) {
  +		        header = (struct mach_header *) [data bytes];
  +		        if (header->magic == MH_MAGIC) {
  +		            isNative = (header->cputype == localArch->cputype);
  +		        } else if (header->magic == MH_CIGAM) {
  +		            isNative = ((cpu_type_t) OSSwapInt32(header->cputype) == localArch->cputype);
  +		        }
  +		        if (!isNative) {
  +		            [self release];
  +		            return nil;
  +		        }
  +		    }
  +		}
  +#endif
       }
   
       if (![self getPluginInfoFromPLists] && ![self getPluginInfoFromResources]) {
  
  
  



More information about the webkit-changes mailing list