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:
elextr 2013-07-18 12:36:42 +10:00
parent 6e902613b3
commit cac1115ced

View File

@ -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);