[gnome-builder] python: fix array boundary when text length is too short
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] python: fix array boundary when text length is too short
- Date: Sat, 3 Oct 2015 21:37:37 +0000 (UTC)
commit 3932b81bb2e2ecf482f2b3c156e866cb385ce4bb
Author: Christian Hergert <christian hergert me>
Date: Sat Oct 3 14:35:47 2015 -0700
python: fix array boundary when text length is too short
plugins/python-pack/python_indenter.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/plugins/python-pack/python_indenter.py b/plugins/python-pack/python_indenter.py
index 1ca0e48..33e255a 100644
--- a/plugins/python-pack/python_indenter.py
+++ b/plugins/python-pack/python_indenter.py
@@ -486,7 +486,7 @@ class PythonIndenter(GObject.Object): #, Ide.Indenter):
forward_to_nonspace(end)
text = prev.get_slice(end)
i = 0
- while i < column:
+ while i < column and i < len(text):
if text[i] == '\t':
if i + 4 > column:
break
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]