Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
xfce4-settings
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
198
Issues
198
List
Boards
Labels
Service Desk
Milestones
Custom Issue Tracker
Custom Issue Tracker
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xfce
xfce4-settings
Commits
6f7ecb05
Commit
6f7ecb05
authored
Feb 06, 2015
by
Sean Davis
🕶
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent potential illegal memory access, move null pointer check to before dereference
parent
e0f9a220
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
8 deletions
+11
-8
dialogs/appearance-settings/main.c
dialogs/appearance-settings/main.c
+6
-6
dialogs/mouse-settings/main.c
dialogs/mouse-settings/main.c
+5
-2
No files found.
dialogs/appearance-settings/main.c
View file @
6f7ecb05
...
...
@@ -167,8 +167,8 @@ cb_toolbar_style_combo_changed (GtkComboBox *combo)
{
gint
active
;
/* Get active item, prevent number outside the array */
active
=
CLAMP
(
gtk_combo_box_get_active
(
combo
),
0
,
(
gint
)
G_N_ELEMENTS
(
toolbar_styles_array
));
/* Get active item, prevent number outside the array
(stay within zero-index)
*/
active
=
CLAMP
(
gtk_combo_box_get_active
(
combo
),
0
,
(
gint
)
G_N_ELEMENTS
(
toolbar_styles_array
)
-
1
);
/* Save setting */
xfconf_channel_set_string
(
xsettings_channel
,
"/Gtk/ToolbarStyle"
,
toolbar_styles_array
[
active
]);
...
...
@@ -194,8 +194,8 @@ cb_hinting_style_combo_changed (GtkComboBox *combo)
{
gint
active
;
/* Get active item, prevent number outside the array */
active
=
CLAMP
(
gtk_combo_box_get_active
(
combo
),
0
,
(
gint
)
G_N_ELEMENTS
(
xft_hint_styles_array
));
/* Get active item, prevent number outside the array
(stay within zero-index)
*/
active
=
CLAMP
(
gtk_combo_box_get_active
(
combo
),
0
,
(
gint
)
G_N_ELEMENTS
(
xft_hint_styles_array
)
-
1
);
/* Save setting */
xfconf_channel_set_string
(
xsettings_channel
,
"/Xft/HintStyle"
,
xft_hint_styles_array
[
active
]);
...
...
@@ -206,8 +206,8 @@ cb_rgba_style_combo_changed (GtkComboBox *combo)
{
gint
active
;
/* Get active item, prevent number outside the array */
active
=
CLAMP
(
gtk_combo_box_get_active
(
combo
),
0
,
(
gint
)
G_N_ELEMENTS
(
xft_rgba_array
));
/* Get active item, prevent number outside the array
(stay within zero-index)
*/
active
=
CLAMP
(
gtk_combo_box_get_active
(
combo
),
0
,
(
gint
)
G_N_ELEMENTS
(
xft_rgba_array
)
-
1
);
/* Save setting */
xfconf_channel_set_string
(
xsettings_channel
,
"/Xft/RGBA"
,
xft_rgba_array
[
active
]);
...
...
dialogs/mouse-settings/main.c
View file @
6f7ecb05
...
...
@@ -1568,6 +1568,10 @@ mouse_settings_device_populate_store (GtkBuilder *builder,
||
g_str_has_prefix
(
device_info
->
name
,
"Virtual core XTEST"
))
continue
;
/* cannot go any further without device name */
if
(
device_info
->
name
==
NULL
)
continue
;
/* create a valid xfconf device name */
xfconf_name
=
mouse_settings_device_xfconf_name
(
device_info
->
name
);
...
...
@@ -1579,8 +1583,7 @@ mouse_settings_device_populate_store (GtkBuilder *builder,
-
1
);
/* check if we should select this device */
if
(
device_info
->
name
!=
NULL
&&
opt_device_name
!=
NULL
if
(
opt_device_name
!=
NULL
&&
strcmp
(
opt_device_name
,
device_info
->
name
)
==
0
)
{
gtk_combo_box_set_active_iter
(
GTK_COMBO_BOX
(
combobox
),
&
iter
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment