Prevent potential null pointer dereference when computing the size of

an attachment.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31814 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Wolfgang Lux 2011-01-01 16:43:34 +00:00
parent 0245f84ad2
commit 678df29a94
2 changed files with 11 additions and 3 deletions

View file

@ -1,3 +1,8 @@
2011-01-01 Wolfgang Lux <wolfgang.lux@gmail.com>
* Source/NSLayoutManager.m (attachmentSize): Prevent potential
null pointer dereference.
2011-01-01 Wolfgang Lux <wolfgang.lux@gmail.com>
* Source/NSTextStorage.m (-removeLayoutManager:): Avoid potential

View file

@ -1325,10 +1325,13 @@ attachmentSize(linefrag_t *lf, NSUInteger glyphIndex)
la = lf->attachments;
la_i = 0;
while (la->pos != glyphIndex && la_i < lf->num_attachments)
if (la)
{
la++;
la_i++;
while (la->pos != glyphIndex && la_i < lf->num_attachments)
{
la++;
la_i++;
}
}
if (la_i >= lf->num_attachments)