Prevent reading past start of Scintilla buffer
A quick check seemed to show Scintilla does not check the minimum value is positive, so just check here to be safe and log message if it fails.
This commit is contained in:
parent
6e902613b3
commit
cac1115ced
@ -665,6 +665,7 @@ static gboolean match_last_chars(ScintillaObject *sci, gint pos, const gchar *st
|
||||
gchar *buf;
|
||||
|
||||
g_return_val_if_fail(len < 100, FALSE);
|
||||
g_return_val_if_fail(len <= pos, FALSE);
|
||||
|
||||
buf = g_alloca(len + 1);
|
||||
sci_get_text_range(sci, pos - len, pos, buf);
|
||||
|
Loading…
x
Reference in New Issue
Block a user