diff options
author | infirit <[email protected]> | 2014-11-08 01:16:18 +0100 |
---|---|---|
committer | infirit <[email protected]> | 2014-11-28 08:51:50 +0100 |
commit | 3a2edbb177ad591f66ed3adf756390837165705c (patch) | |
tree | 29426c1e6ef5055a0f2b1e08917209c731b78f73 | |
parent | 9eb73289026c9c2241055e7c286ea16a519eb667 (diff) | |
download | mate-desktop-3a2edbb177ad591f66ed3adf756390837165705c.tar.bz2 mate-desktop-3a2edbb177ad591f66ed3adf756390837165705c.tar.xz |
Disallow null filenames passed to mate_rr_config_load_filename()
Based on gnome-desktop commit: 7c2e51427fff29f1582eb5ed035f8c7637ea908f
From: Federico Mena Quintero <[email protected]>
-rw-r--r-- | libmate-desktop/mate-rr-config.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libmate-desktop/mate-rr-config.c b/libmate-desktop/mate-rr-config.c index 1c13630..f20e67d 100644 --- a/libmate-desktop/mate-rr-config.c +++ b/libmate-desktop/mate-rr-config.c @@ -671,6 +671,7 @@ mate_rr_config_load_filename (MateRRConfig *result, const char *filename, GError gboolean found = FALSE; g_return_val_if_fail (MATE_IS_RR_CONFIG (result), FALSE); + g_return_val_if_fail (filename != NULL, FALSE); g_return_val_if_fail (error == NULL || *error == NULL, FALSE); if (filename == NULL) @@ -748,8 +749,16 @@ MateRRConfig * mate_rr_config_new_stored (MateRRScreen *screen, GError **error) { MateRRConfig *self = g_object_new (MATE_TYPE_RR_CONFIG, "screen", screen, NULL); + char *filename; + gboolean success; + + filename = mate_rr_config_get_intended_filename (); - if (mate_rr_config_load_filename (self, NULL, error)) + success = mate_rr_config_load_filename (self, filename, error); + + g_free (filename); + + if (success) return self; else { |