From 65748dc8d9de25a21c4ce092379ffcdc36fe237e Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Tue, 8 Jul 2008 16:15:41 +0000 Subject: [PATCH] Remove() was moving an additional array element. Mostly harmless, but would cause a crash when the array end was page-aligned and the next page was not accessible. Happened to me during a "rm -rf ...". git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26320 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/file_systems/bfs/Utility.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/add-ons/kernel/file_systems/bfs/Utility.cpp b/src/add-ons/kernel/file_systems/bfs/Utility.cpp index 452ee68fa3..50e33ba29c 100644 --- a/src/add-ons/kernel/file_systems/bfs/Utility.cpp +++ b/src/add-ons/kernel/file_systems/bfs/Utility.cpp @@ -60,8 +60,8 @@ sorted_array::Remove(off_t value) if (index == -1) return false; - memmove(&values[index], &values[index + 1], (count - index) * sizeof(off_t)); count--; + memmove(&values[index], &values[index + 1], (count - index) * sizeof(off_t)); return true; }