[evolution/wip/webkit2] mail_display_get_font_settings: Can be called with some output variables NULL
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/wip/webkit2] mail_display_get_font_settings: Can be called with some output variables NULL
- Date: Tue, 24 May 2016 19:26:39 +0000 (UTC)
commit f7970a84a043f79d823ae0335424c8c9fa0ab502
Author: Milan Crha <mcrha redhat com>
Date: Tue May 24 21:26:11 2016 +0200
mail_display_get_font_settings: Can be called with some output variables NULL
Which leads to a NULL dereference and a crash.
mail/e-mail-display.c | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/mail/e-mail-display.c b/mail/e-mail-display.c
index a7fe93b..417e61a 100644
--- a/mail/e-mail-display.c
+++ b/mail/e-mail-display.c
@@ -1388,18 +1388,20 @@ mail_display_get_font_settings (GSettings *settings,
use_custom_font = g_settings_get_boolean (settings, "use-custom-font");
if (!use_custom_font) {
- *monospace = NULL;
- *variable = NULL;
+ if (monospace)
+ *monospace = NULL;
+ if (variable)
+ *variable = NULL;
return;
}
monospace_font = g_settings_get_string (settings, "monospace-font");
variable_font = g_settings_get_string (settings, "variable-width-font");
- *monospace = (monospace_font != NULL) ?
- pango_font_description_from_string (monospace_font) : NULL;
- *variable = (variable_font != NULL) ?
- pango_font_description_from_string (variable_font) : NULL;
+ if (monospace)
+ *monospace = (monospace_font != NULL) ? pango_font_description_from_string (monospace_font) :
NULL;
+ if (variable)
+ *variable = (variable_font != NULL) ? pango_font_description_from_string (variable_font) :
NULL;
g_free (monospace_font);
g_free (variable_font);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]