[gnome-control-center/benzea/fix-display-no-mode-scale-crash: 1/2] display: Add guard for NULL mode in supported scale check
- From: Benjamin Berg <bberg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/benzea/fix-display-no-mode-scale-crash: 1/2] display: Add guard for NULL mode in supported scale check
- Date: Thu, 10 Oct 2019 07:55:38 +0000 (UTC)
commit d2d1e042d164a59db312c0dbbaf5813c6b7d272c
Author: Benjamin Berg <bberg redhat com>
Date: Thu Oct 10 09:50:30 2019 +0200
display: Add guard for NULL mode in supported scale check
This may prevent crashes in certain error situations.
panels/display/cc-display-config-dbus.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/panels/display/cc-display-config-dbus.c b/panels/display/cc-display-config-dbus.c
index 81b2c46f7..cdddbb695 100644
--- a/panels/display/cc-display-config-dbus.c
+++ b/panels/display/cc-display-config-dbus.c
@@ -107,8 +107,10 @@ cc_display_mode_dbus_is_supported_scale (CcDisplayMode *pself,
double scale)
{
CcDisplayModeDBus *self = CC_DISPLAY_MODE_DBUS (pself);
-
guint i;
+
+ g_return_val_if_fail (pself != NULL, FALSE);
+
for (i = 0; i < self->supported_scales->len; i++)
if (g_array_index (self->supported_scales, double, i) == scale)
return TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]