[ostree] core: Fix 32/8 bit confusion in pack index listing



commit 8d6bdaedfe0cd3904d8bde82dc11e3aa46b79ecc
Author: Colin Walters <walters verbum org>
Date:   Tue May 1 16:26:10 2012 -0400

    core: Fix 32/8 bit confusion in pack index listing

 src/libostree/ostree-core.c |    2 ++
 src/libostree/ostree-repo.c |    2 +-
 2 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/libostree/ostree-core.c b/src/libostree/ostree-core.c
index d649d38..37a0737 100644
--- a/src/libostree/ostree-core.c
+++ b/src/libostree/ostree-core.c
@@ -767,6 +767,8 @@ GVariant *
 ostree_object_name_serialize (const char *checksum,
                               OstreeObjectType objtype)
 {
+  g_assert (objtype >= OSTREE_OBJECT_TYPE_FILE
+            && objtype <= OSTREE_OBJECT_TYPE_COMMIT);
   return g_variant_new ("(su)", checksum, (guint32)objtype);
 }
 
diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c
index 3aad785..3fcf084 100644
--- a/src/libostree/ostree-repo.c
+++ b/src/libostree/ostree-repo.c
@@ -3327,7 +3327,7 @@ list_objects_in_index (OstreeRepo                     *self,
 {
   gboolean ret = FALSE;
   OstreeRepoPrivate *priv = GET_PRIVATE (self);
-  guint32 objtype_u8;
+  guint8 objtype_u8;
   guint64 offset;
   ot_lobj GFile *index_path = NULL;
   ot_lvariant GVariant *index_variant = NULL;



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