Monotone-Parent: 915f4f176feb772bfa74b034b6b7ce28f66778f8

Monotone-Revision: 4fb71d76cac3b87ffc098133f9c93d0e753c5284

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2010-05-05T13:46:58
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Wolfgang Sourdeau 2010-05-05 13:46:58 +00:00
parent 2864ffff1e
commit 37cbdd4378
2 changed files with 19 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2010-05-05 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* VSSaxDriver.m (_endComponent:value:): avoid a crash occurring
when an inconsistency is found in the stack of containers.
2009-12-22 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* VSSaxDriver.m (_endComponent:value:): worked-around the lameness

View File

@ -31,6 +31,7 @@
#import "VSSaxDriver.h"
#import <SaxObjC/SaxException.h>
#import <NGExtensions/NGQuotedPrintableCoding.h>
#import <NGExtensions/NSObject+Logs.h>
#import <NGExtensions/NSString+Encoding.h>
#import <NGCards/NSString+NGCards.h>
#import "common.h"
@ -653,6 +654,7 @@ static NSCharacterSet *whitespaceCharSet = nil;
value: (NSString *) tagValue
{
NSString *mtName;
int max;
mtName = [[self _mapTagName: tagValue] uppercaseString];
if ([cardStack count] > 0)
@ -692,11 +694,19 @@ static NSCharacterSet *whitespaceCharSet = nil;
stringByAppendingString: mtName]];
}
[self _endGroupElementTag: mtName];
[cardStack removeLastObject];
max = [cardStack count];
if (max > 0)
{
[cardStack removeLastObject];
max--;
}
else
[self errorWithFormat: @"serious inconsistency among begin/end tags"];
/* report parsed elements */
if ([cardStack count] == 0)
if (max == 0)
[self reportQueuedTags];
}