40 lines
1.1 KiB
Diff
40 lines
1.1 KiB
Diff
|
commit 5645064bb35802aa9e9167cac5223fddb8852859
|
||
|
Author: Vincent Untz <vuntz@gnome.org>
|
||
|
Date: Wed Oct 12 11:46:54 2011 +0200
|
||
|
|
||
|
Correctly initialize the variables when checking version update
|
||
|
|
||
|
Else, we end up with non-initialized memory and "Cannot upgrade from
|
||
|
version <random data>".
|
||
|
|
||
|
https://bugzilla.gnome.org/show_bug.cgi?id=661542
|
||
|
|
||
|
diff --git a/shell/e-shell-migrate.c b/shell/e-shell-migrate.c
|
||
|
index 89f94b0..dd75a40 100644
|
||
|
--- a/shell/e-shell-migrate.c
|
||
|
+++ b/shell/e-shell-migrate.c
|
||
|
@@ -739,6 +739,10 @@ shell_migrate_get_version (EShell *shell,
|
||
|
const gchar *key;
|
||
|
gchar *string;
|
||
|
|
||
|
+ *major = 0;
|
||
|
+ *minor = 0;
|
||
|
+ *micro = 0;
|
||
|
+
|
||
|
key = GCONF_VERSION_KEY;
|
||
|
client = e_shell_get_gconf_client (shell);
|
||
|
string = gconf_client_get_string (client, key, NULL);
|
||
|
@@ -747,12 +751,6 @@ shell_migrate_get_version (EShell *shell,
|
||
|
/* Since 1.4.0 we've kept the version key in GConf. */
|
||
|
sscanf (string, "%d.%d.%d", major, minor, micro);
|
||
|
g_free (string);
|
||
|
-
|
||
|
- } else {
|
||
|
- /* Otherwise, assume it's a new installation. */
|
||
|
- *major = 0;
|
||
|
- *minor = 0;
|
||
|
- *micro = 0;
|
||
|
}
|
||
|
}
|
||
|
|