From cac1115ced305f4828cbc49f08c12d95e05d9e85 Mon Sep 17 00:00:00 2001 From: elextr Date: Thu, 18 Jul 2013 12:36:42 +1000 Subject: [PATCH] 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. --- src/editor.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/editor.c b/src/editor.c index 12a0f9ecc..3ed58b60f 100644 --- a/src/editor.c +++ b/src/editor.c @@ -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); -- 2.11.4.GIT