mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-02 22:00:59 +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
79c185750b
commit
c5cc86b23b
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>
|
2011-01-01 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||||
|
|
||||||
* Source/NSTextStorage.m (-removeLayoutManager:): Avoid potential
|
* Source/NSTextStorage.m (-removeLayoutManager:): Avoid potential
|
||||||
|
|
|
@ -1325,11 +1325,14 @@ attachmentSize(linefrag_t *lf, NSUInteger glyphIndex)
|
||||||
la = lf->attachments;
|
la = lf->attachments;
|
||||||
la_i = 0;
|
la_i = 0;
|
||||||
|
|
||||||
|
if (la)
|
||||||
|
{
|
||||||
while (la->pos != glyphIndex && la_i < lf->num_attachments)
|
while (la->pos != glyphIndex && la_i < lf->num_attachments)
|
||||||
{
|
{
|
||||||
la++;
|
la++;
|
||||||
la_i++;
|
la_i++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (la_i >= lf->num_attachments)
|
if (la_i >= lf->num_attachments)
|
||||||
return NSMakeSize(-1.0, -1.0);
|
return NSMakeSize(-1.0, -1.0);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue