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)
|
gint len)
|
||||||
{
|
{
|
||||||
/* Find next sentence start or end */
|
/* Find next sentence start or end */
|
||||||
while (offset >= min_offset &&
|
while (!(attrs[offset].is_sentence_start || attrs[offset].is_sentence_end))
|
||||||
!(attrs[offset].is_sentence_start || attrs[offset].is_sentence_end))
|
{
|
||||||
--offset;
|
--offset;
|
||||||
|
if (offset < min_offset)
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
return attrs[offset].is_sentence_start;
|
return attrs[offset].is_sentence_start;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user