Fix possible pointer past end of data

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@16213 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2003-03-20 11:38:16 +00:00
parent bbfcf1ff52
commit 04e888af0a
2 changed files with 7 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2003-03-20 Richard Frith-Macdonald <rfm@gnu.org>
* Source/GSMime.m: (_unfoldHeader) Check that input pointer doesn't
run past end of data.
2003-03-05 15:50 Alexander Malmberg <alexander@malmberg.org>
* Source/NSBundle.m (+initialize) [PROCFS_EXE_LINK]: Make sure that

View file

@ -2428,7 +2428,8 @@ NSDebugMLLog(@"GSMime", @"Header parsed - %@", info);
/*
* See if we have a wrapped line.
*/
if ((c = bytes[input]) == '\r' || c == '\n' || isspace(c) == 0)
if (input < dataEnd
&& ((c = bytes[input]) == '\r' || c == '\n' || isspace(c) == 0))
{
unwrappingComplete = YES;
bytes[lineEnd] = '\0';