[ostree] libostree/upgrader: Throw an error if osname is empty
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ostree] libostree/upgrader: Throw an error if osname is empty
- Date: Tue, 25 Mar 2014 19:48:05 +0000 (UTC)
commit 90883674a9dd57fa92bf98e9416c42ac268641b9
Author: Colin Walters <walters verbum org>
Date: Tue Mar 25 15:47:20 2014 -0400
libostree/upgrader: Throw an error if osname is empty
This shouldn't happen; I'm just adding the check to force a rebuild.
src/libostree/ostree-sysroot-upgrader.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/libostree/ostree-sysroot-upgrader.c b/src/libostree/ostree-sysroot-upgrader.c
index c565434..573d3d2 100644
--- a/src/libostree/ostree-sysroot-upgrader.c
+++ b/src/libostree/ostree-sysroot-upgrader.c
@@ -115,6 +115,12 @@ ostree_sysroot_upgrader_initable_init (GInitable *initable,
g_assert (booted_deployment);
self->osname = g_strdup (ostree_deployment_get_osname (booted_deployment));
}
+ else if (self->osname[0] == '\0')
+ {
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ "Invalid empty osname");
+ goto out;
+ }
self->merge_deployment = ostree_sysroot_get_merge_deployment (self->sysroot, self->osname);
if (self->merge_deployment == NULL)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]