mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 10:01:14 +00:00
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:
parent
0245f84ad2
commit
678df29a94
2 changed files with 11 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue