Fix possible exception setting header value

This commit is contained in:
Richard Frith-Macdonald 2023-02-09 11:03:21 +00:00
parent b8aedfc53e
commit 3631c4b068
2 changed files with 11 additions and 2 deletions

View file

@ -1,3 +1,9 @@
2022-02-09 Richard Frith-Macdonald <rfm@gnu.org>
* Source/Additions/GSMime.m: ([GSMimeHeader setValue:]) do not set
type/subtype information if the content-type header value is not
in that format.
2022-01-01 Richard Frith-Macdonald <rfm@gnu.org>
* Source/GSHTTPURLHandle.m: fix incorrect close of socket at the end

View file

@ -4688,8 +4688,11 @@ appendString(NSMutableData *m, NSUInteger offset, NSUInteger fold,
NSArray *a;
a = [[value lowercaseString] componentsSeparatedByString: @"/"];
[self setObject: [a objectAtIndex: 0] forKey: @"Type"];
[self setObject: [a objectAtIndex: 1] forKey: @"Subtype"];
if ([a count] == 2)
{
[self setObject: [a objectAtIndex: 0] forKey: @"Type"];
[self setObject: [a objectAtIndex: 1] forKey: @"Subtype"];
}
}
}