mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 13:30:37 +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
|
@ -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…
Add table
Add a link
Reference in a new issue