Fix crash when deploying with implicit os name

When booted into an ostree you can deploy without passing
an --os option. That was crashing though, because
ot_admin_complete_deploy_one is called with NULL
osname but it was not handling it properly.

https://bugzilla.gnome.org/show_bug.cgi?id=710970
This commit is contained in:
Daniel Narvaez 2013-10-27 19:39:02 +01:00 committed by Colin Walters
parent 03aa10f17d
commit 7ecfbff26e
1 changed files with 2 additions and 1 deletions

View File

@ -77,7 +77,8 @@ ot_admin_complete_deploy_one (OstreeSysroot *sysroot,
* booted and merge deployments * booted and merge deployments
*/ */
if (opt_retain || if (opt_retain ||
strcmp (ostree_deployment_get_osname (deployment), osname) != 0 || (osname != NULL &&
strcmp (ostree_deployment_get_osname (deployment), osname) != 0) ||
ostree_deployment_equal (deployment, booted_deployment) || ostree_deployment_equal (deployment, booted_deployment) ||
ostree_deployment_equal (deployment, merge_deployment)) ostree_deployment_equal (deployment, merge_deployment))
{ {