summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMonsta <[email protected]>2014-11-19 21:18:59 +0300
committerStefano Karapetsas <[email protected]>2014-11-20 08:33:57 +0100
commit0040e135e587c476abd7d99d7a47ae146bad0f55 (patch)
tree090e906ba7d8c78feb69027fca2efc09d96df67d /src
parent4b5d33e7ee3a5bdd8d40972a1e2ee78875616dcb (diff)
downloadmate-user-share-0040e135e587c476abd7d99d7a47ae146bad0f55.tar.bz2
mate-user-share-0040e135e587c476abd7d99d7a47ae146bad0f55.tar.xz
Fixed logic flow (out-of-bounds array access if bluetooth is disabled)
Diffstat (limited to 'src')
-rw-r--r--src/share-extension.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/share-extension.c b/src/share-extension.c
index bbc34ff..213b044 100644
--- a/src/share-extension.c
+++ b/src/share-extension.c
@@ -145,7 +145,7 @@ caja_user_share_get_location_widget (CajaLocationWidgetProvider *iface,
const GUserDirectory special_dirs[] = { G_USER_DIRECTORY_PUBLIC_SHARE };
gboolean is_dir[] = { FALSE };
-#endif
+#endif /* HAVE_BLUETOOTH */
file = g_file_new_for_uri (uri);
home = g_file_new_for_path (g_get_home_dir ());
@@ -171,14 +171,16 @@ caja_user_share_get_location_widget (CajaLocationWidgetProvider *iface,
if (enable == FALSE)
return NULL;
- if (is_dir[0] != FALSE && is_dir[1] != FALSE) {
- bar = caja_share_bar_new (_("May be used to share or receive files"));
- } else if (is_dir[0] != FALSE) {
-#ifndef HAVE_BLUETOOTH
- bar = caja_share_bar_new (_("May be shared over the network or Bluetooth"));
+ if (is_dir[0] != FALSE) {
+#ifdef HAVE_BLUETOOTH
+ if (is_dir[1] != FALSE) {
+ bar = caja_share_bar_new (_("May be used to share or receive files"));
+ } else {
+ bar = caja_share_bar_new (_("May be shared over the network or Bluetooth"));
+ }
#else
bar = caja_share_bar_new (_("May be shared over the network"));
-#endif /* !HAVE_BLUETOOTH */
+#endif /* HAVE_BLUETOOTH */
} else {
#ifdef HAVE_BLUETOOTH
BluetoothClient *client;