summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarald Judt <h.judt@gmx.at>2015-04-22 12:56:39 +0200
committerHarald Judt <h.judt@gmx.at>2015-04-22 13:04:53 +0200
commit460f70261d80f65ef7dd6757b173bbf835ceb5c5 (patch)
treecab9e514cb9cb56a2f41691312931759d542744b
parent503db56621fb19f51f15964e1ce79c7adaf2f8a1 (diff)
downloadthunar-460f70261d80f65ef7dd6757b173bbf835ceb5c5.tar.gz
Coverity CID 60619: Explicit null dereferenced
CID 60619 (#1 of 1): Explicit null dereferenced (FORWARD_NULL) 20. var_deref_op: Dereferencing null pointer left_button.
-rw-r--r--thunar/thunar-location-buttons.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/thunar/thunar-location-buttons.c b/thunar/thunar-location-buttons.c
index 6979ec6e..5a021274 100644
--- a/thunar/thunar-location-buttons.c
+++ b/thunar/thunar-location-buttons.c
@@ -1080,7 +1080,7 @@ thunar_location_buttons_scroll_right (GtkWidget *button,
}
if (G_UNLIKELY (right_button == NULL))
- return;
+ return;
/* find the last visible button on the 'left' end */
for (lp = g_list_last (buttons->list); lp != NULL; lp = lp->prev)
@@ -1101,6 +1101,9 @@ thunar_location_buttons_scroll_right (GtkWidget *button,
- (buttons->right_slider->allocation.x + buttons->right_slider->allocation.width);
}
+ if (G_UNLIKELY (left_button == NULL))
+ return;
+
/* We have space_available extra space that's not being used. We
* need space_needed space to make the button fit. So we walk down
* from the end, removing buttons until we get all the space we