+2004-10-19 Marcus Mueller <znek@mulle-kybernetik.com>
+
+ * v4.3.9
+
+ * VSSaxDriver.m: improved robustness in respect to illegal content
+ lines - the parser shouldn't crash anymore. Also, changed the
+ "OGoDebugVersitSaxDriver" default to "VSSaxDriverDebugEnabled".
+
+ * README: documented the default
+
2004-10-18 Marcus Mueller <znek@mulle-kybernetik.com>
* v4.3.8
didInit = YES;
ud = [NSUserDefaults standardUserDefaults];
- debugOn = [ud boolForKey:@"OGoDebugVersitSaxDriver"];
+ debugOn = [ud boolForKey:@"VSSaxDriverDebugEnabled"];
dotCharSet =
[[NSCharacterSet characterSetWithCharactersInString:@"."] retain];
unsigned length;
length = [_line length];
- tagAttributes = [[NSMutableArray alloc] init];
todoRange = NSMakeRange(0, length);
r = [_line rangeOfCharacterFromSet:colonAndSemicolonCharSet
options:0
range:todoRange];
+ if(r.length == 0) {
+ if(debugOn) {
+ NSLog(@"%s got an improper content line! ->\n%@",
+ __PRETTY_FUNCTION__,
+ _line);
+ }
+ return;
+ }
+
tagName = [[_line substringToIndex:r.location] uppercaseString];
+ tagAttributes = [[NSMutableArray alloc] init];
+
if([_line characterAtIndex:r.location] != ':') {
BOOL isAtEnd = NO, isInDquote = NO;
unsigned start = NSMaxRange(r);
r = [_line rangeOfCharacterFromSet:colonSemicolonAndDquoteCharSet
options:0
range:todoRange];
+ /* is line well-formed ? */
+ if(r.length == 0 || r.location == 0) {
+ if(debugOn) {
+ NSLog(@"%s got an improper content line! ->\n%@",
+ __PRETTY_FUNCTION__,
+ _line);
+ }
+ [tagAttributes release];
+ return;
+ }
/* first check if delimiter candidate is escaped */
if([_line characterAtIndex:(r.location - 1)] != '\\') {
unichar delimiter;