[file-roller] Fix integer overflow bug when comparing large files/directories
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [file-roller] Fix integer overflow bug when comparing large files/directories
- Date: Mon, 31 Oct 2016 07:32:41 +0000 (UTC)
commit fe313596f6a0511832c942eb4a539cffdd4eb5e3
Author: Jan Achterhold <devel janachterhold de>
Date: Sun Oct 23 17:11:10 2016 +0200
Fix integer overflow bug when comparing large files/directories
src/fr-window.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/fr-window.c b/src/fr-window.c
index bb31134..3d63fe0 100644
--- a/src/fr-window.c
+++ b/src/fr-window.c
@@ -5128,6 +5128,7 @@ size_column_sort_func (GtkTreeModel *model,
FileData *fdata2;
GtkSortType sort_order;
int result;
+ goffset size_difference;
gtk_tree_sortable_get_sort_column_id (GTK_TREE_SORTABLE (model), NULL, &sort_order);
@@ -5136,9 +5137,10 @@ size_column_sort_func (GtkTreeModel *model,
if (file_data_is_dir (fdata1) == file_data_is_dir (fdata2)) {
if (file_data_is_dir (fdata1))
- result = fdata1->dir_size - fdata2->dir_size;
+ size_difference = fdata1->dir_size - fdata2->dir_size;
else
- result = fdata1->size - fdata2->size;
+ size_difference = fdata1->size - fdata2->size;
+ result = (size_difference > 0) - (size_difference < 0);
}
else {
result = file_data_is_dir (fdata1) ? -1 : 1;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]