mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
fix possible infinite recursion
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@36579 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
381d526dfc
commit
446ae5e104
2 changed files with 12 additions and 7 deletions
|
@ -1,3 +1,8 @@
|
|||
2013-04-24 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/GSMime.m: ([GSMimeParser-parse:]) fix possible infinite
|
||||
recursion when encountering a bad document.
|
||||
|
||||
2013-04-22 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/GSMime.m: Fix memory management error with excess bytes
|
||||
|
|
|
@ -1447,13 +1447,13 @@ wordData(NSString *word)
|
|||
*/
|
||||
- (BOOL) parse: (NSData*)d
|
||||
{
|
||||
if (flags.complete == 1)
|
||||
if (1 == flags.complete || 1 == flags.hadErrors)
|
||||
{
|
||||
return NO; /* Already completely parsed! */
|
||||
return NO; /* Already completely parsed or failed! */
|
||||
}
|
||||
if ([d length] > 0)
|
||||
{
|
||||
if (flags.inBody == 0)
|
||||
if (0 == flags.inBody)
|
||||
{
|
||||
if ([self parseHeaders: d remaining: &d] == YES)
|
||||
{
|
||||
|
@ -1462,7 +1462,7 @@ wordData(NSString *word)
|
|||
}
|
||||
if ([d length] > 0)
|
||||
{
|
||||
if (flags.inBody == 1)
|
||||
if (1 == flags.inBody)
|
||||
{
|
||||
/*
|
||||
* We can't just re-call -parse: ...
|
||||
|
@ -1475,7 +1475,7 @@ wordData(NSString *word)
|
|||
return [self parse: d];
|
||||
}
|
||||
}
|
||||
if (flags.complete == 1)
|
||||
if (1 == flags.complete)
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
@ -1483,11 +1483,11 @@ wordData(NSString *word)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (flags.wantEndOfLine == 1)
|
||||
if (1 == flags.wantEndOfLine)
|
||||
{
|
||||
[self parse: [NSData dataWithBytes: "\r\n" length: 2]];
|
||||
}
|
||||
else if (flags.inBody == 1)
|
||||
else if (1 == flags.inBody)
|
||||
{
|
||||
[self _decodeBody: d];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue