Revision: 11532
          http://bibdesk.svn.sourceforge.net/bibdesk/?rev=11532&view=rev
Author:   amaxwell
Date:     2007-11-10 10:22:41 -0800 (Sat, 10 Nov 2007)

Log Message:
-----------
check length before getting characters

Modified Paths:
--------------
    trunk/bibdesk/BDSKACMDLParser.m

Modified: trunk/bibdesk/BDSKACMDLParser.m
===================================================================
--- trunk/bibdesk/BDSKACMDLParser.m     2007-11-10 18:12:46 UTC (rev 11531)
+++ trunk/bibdesk/BDSKACMDLParser.m     2007-11-10 18:22:41 UTC (rev 11532)
@@ -83,6 +83,15 @@
     NSString *onClickValue = [btlinknode stringValueOfAttribute:@"onclick"];
 
     // string should look like "window.open('.*');". Trim off the outer stuff:
+    
+    // check length in case this changes at some point in future, though!
+    if ([bibTeXWindowURLPath length] < 16) {
+        if (outError) {
+            *outError = [NSError mutableLocalErrorWithCode:kBDSKUnknownError 
localizedDescription:NSLocalizedString(@"Window URL path string shorter than 
expected", @"ACM parser error")];
+            return nil;
+        }
+    }
+    
     NSString *bibTeXWindowURLPath = [onClickValue 
substringWithRange:NSMakeRange(13, [onClickValue length] - 13 - 3)];
     
     NSURL *btwinURL = [NSURL URLWithString:[NSString 
stringWithFormat:@"http://%@/%@";, [url host], bibTeXWindowURLPath]];


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to