commit ffba54dca7e0dab0ec6ab8ae489cf8de3daadd84
Author: Sam Thursfield <sam.thursfield@codethink.co.uk>
Date:   Mon Mar 30 15:48:36 2015 +0100

    Fix possible crash in ostree_mutable_tree_walk()
    
    If the starting index is beyond the end of the list, it's a programming
    error. Previously, the code was trying to raise a runtime error, but
    actually causing a segfault.
    
    This was detected by test code in test-mutable-tree.c, which is
    removed in this commit because it should now not be possible to crash
    here.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=747032

diff --git a/src/libostree/ostree-mutable-tree.c b/src/libostree/ostree-mutable-tree.c
index 26a1ca4..6570b4b 100644
--- a/src/libostree/ostree-mutable-tree.c
+++ b/src/libostree/ostree-mutable-tree.c
@@ -315,11 +315,9 @@ ostree_mutable_tree_walk (OstreeMutableTree     *self,
                           OstreeMutableTree    **out_subdir,
                           GError               **error)
 {
-  if (start >= split_path->len)
-    {
-      return set_error_noent (error, (char*)split_path->pdata[start]);
-    }
-  else if (start == split_path->len - 1)
+  g_return_if_fail (start < split_path->len);
+
+  if (start == split_path->len - 1)
     {
       *out_subdir = g_object_ref (self);
       return TRUE;
diff --git a/tests/test-mutable-tree.c b/tests/test-mutable-tree.c
index ef2b6b5..b0c2386 100644
--- a/tests/test-mutable-tree.c
+++ b/tests/test-mutable-tree.c
@@ -70,13 +70,6 @@ test_mutable_tree_walk (void)
 
   {
     gs_unref_object OstreeMutableTree *subdir = NULL;
-    g_assert_false (ostree_mutable_tree_walk (tree, split_path, 10, &subdir, &error));
-    g_assert_null (subdir);
-    g_clear_error (&error);
-  }
-
-  {
-    gs_unref_object OstreeMutableTree *subdir = NULL;
     gs_unref_object OstreeMutableTree *a = NULL;
     gs_free char *source_checksum = NULL;
     ostree_mutable_tree_lookup (tree, "a", &source_checksum, &a, &error);
