[ostree: 61/70] commit: Fix crash if dfd_iter is NULL



commit 77ea287cd240825af311f8ac06f272b9a3981b54
Author: Alexander Larsson <alexl redhat com>
Date:   Wed Apr 13 21:18:19 2016 +0200

    commit: Fix crash if dfd_iter is NULL
    
    in write_directory_content_to_mtree_internal dfd_iter can be NULL,
    for instance if commiting from --tree=ref=FOO. Don't blindly de-ref
    it to avoid crashing.
    
    Closes: #256
    Approved by: cgwalters

 src/libostree/ostree-repo-commit.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/libostree/ostree-repo-commit.c b/src/libostree/ostree-repo-commit.c
index 0fb3b0f..7f03e11 100644
--- a/src/libostree/ostree-repo-commit.c
+++ b/src/libostree/ostree-repo-commit.c
@@ -2525,7 +2525,7 @@ write_directory_content_to_mtree_internal (OstreeRepo                  *self,
             }
 
           if (!get_modified_xattrs (self, modifier,
-                                    child_relpath, child_info, child, dfd_iter->fd, name,
+                                    child_relpath, child_info, child, dfd_iter != NULL ? dfd_iter->fd : -1, 
name,
                                     &xattrs,
                                     cancellable, error))
             goto out;


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