mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 19:00:08 +00:00
Avoid an out-of-bounds access
When the offset gets smaller than min_offset, we can't access the array at that position.
This commit is contained in:
parent
8ff40b5d14
commit
ca3d87ce70
@ -3073,9 +3073,12 @@ inside_sentence_func (const PangoLogAttr *attrs,
|
||||
gint len)
|
||||
{
|
||||
/* Find next sentence start or end */
|
||||
while (offset >= min_offset &&
|
||||
!(attrs[offset].is_sentence_start || attrs[offset].is_sentence_end))
|
||||
--offset;
|
||||
while (!(attrs[offset].is_sentence_start || attrs[offset].is_sentence_end))
|
||||
{
|
||||
--offset;
|
||||
if (offset < min_offset)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return attrs[offset].is_sentence_start;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user