[gnome-builder/gnome-builder-3-18] snippet: check lower/upper bounds before iterating array



commit b5ecf3c2604753f22cd0855f7cdbda5eb7dedab2
Author: Christian Hergert <christian hergert me>
Date:   Sat Oct 3 16:19:33 2015 -0700

    snippet: check lower/upper bounds before iterating array

 libide/ide-source-snippet.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/libide/ide-source-snippet.c b/libide/ide-source-snippet.c
index df62da0..b14b26d 100644
--- a/libide/ide-source-snippet.c
+++ b/libide/ide-source-snippet.c
@@ -751,6 +751,9 @@ ide_source_snippet_before_delete_range (IdeSourceSnippet *self,
       break;
     }
 
+  if (lower_bound == -1 || upper_bound == -1)
+    return;
+
   for (i = lower_bound; i <= upper_bound; i++)
     {
       chunk = g_ptr_array_index (self->chunks, i);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]