[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

sullivan sullivan at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:17:03 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit e239cb6039c93eb5878f43b68750e79ceb69bc64
Author: sullivan <sullivan at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Dec 9 21:23:07 2003 +0000

            - fixed <rdar://problem/3504907>: REGRESSION (100-116):
            Clicking QuickTime-requiring link twice crashes (wholenote.com)
    
            I found the bug; Darin wrote the fix; I reviewed and tested.
    
            * Plugins.subproj/WebNetscapePluginPackage.m:
            (-[WebNetscapePluginPackage stringForStringListID:andIndex:]):
            Rewrote this method to not use GetIndString, because GetIndString looks
            at all open resource files and in this case was reading information from
            the wrong plugin file.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5726 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index bd99d72..b547bcd 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,16 @@
+2003-12-09  John Sullivan  <sullivan at apple.com>
+
+        - fixed <rdar://problem/3504907>: REGRESSION (100-116): 
+        Clicking QuickTime-requiring link twice crashes (wholenote.com)
+
+        I found the bug; Darin wrote the fix; I reviewed and tested.
+
+        * Plugins.subproj/WebNetscapePluginPackage.m:
+        (-[WebNetscapePluginPackage stringForStringListID:andIndex:]):
+        Rewrote this method to not use GetIndString, because GetIndString looks
+        at all open resource files and in this case was reading information from
+        the wrong plugin file.
+
 2003-12-08  Chris Blumenberg  <cblu at apple.com>
 
 	Fixed: <rdar://problem/3234676>: Support for KEYGEN tag (ie 509 email certificates from www.thawte.com)
diff --git a/WebKit/Plugins.subproj/WebNetscapePluginPackage.m b/WebKit/Plugins.subproj/WebNetscapePluginPackage.m
index e7cad17..4f30b06 100644
--- a/WebKit/Plugins.subproj/WebNetscapePluginPackage.m
+++ b/WebKit/Plugins.subproj/WebNetscapePluginPackage.m
@@ -81,17 +81,28 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
 
 - (NSString *)stringForStringListID:(SInt16)stringListID andIndex:(SInt16)index
 {
-    Str255 pString;
-    char cString[256];
-        
-    GetIndString(pString, stringListID, index);
-    if (pString[0] == 0) {
+    // Get resource, and dereference the handle.
+    Handle stringHandle = Get1Resource('STR#', stringListID);
+    if (stringHandle == NULL) {
         return nil;
     }
-
-    CopyPascalStringToC(pString, cString);
+    unsigned char *p = (unsigned char *)*stringHandle;
+    if (p == NULL) {
+        return nil;
+    }
+    
+    // Check the index against the length of the string list, then skip the length.
+    if (index < 1 || index > *(SInt16 *)p) {
+        return nil;
+    }
+    p += sizeof(SInt16);
+    
+    // Skip any strings that come before the one we are looking for.
+    while (--index)
+        p += 1 + *p;
     
-    return [NSString stringWithCString:cString];
+    // Convert the one we found into an NSString.
+    return [[[NSString alloc] initWithBytes:(p + 1) length:*p encoding:NSMacOSRomanStringEncoding] autorelease];
 }
 
 - (BOOL)getPluginInfoFromResources

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list