[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-recutils] [PATCH 07/13] src: fix index range checks.
From: |
Michał Masłowski |
Subject: |
[bug-recutils] [PATCH 07/13] src: fix index range checks. |
Date: |
Mon, 20 Aug 2012 18:21:28 +0200 |
---
ChangeLog | 6 ++++++
src/rec-idx-file.c | 4 ++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 9de0115..2df5fca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2012-08-18 Michał Masłowski <address@hidden>
+ src: fix index range checks.
+ * src/rec-idx-file.c (rec_idx_file_index): Check if the end of the
+ index is after the end of buffer, not after the start.
+
+2012-08-18 Michał Masłowski <address@hidden>
+
utils,doc: make recfix --build-index add index trees.
* utils/recfix.c (recfix_do_build_index): Add indexes from %key or
diff --git a/src/rec-idx-file.c b/src/rec-idx-file.c
index 1713d2c..d519260 100644
--- a/src/rec-idx-file.c
+++ b/src/rec-idx-file.c
@@ -308,12 +308,12 @@ rec_idx_file_index (rec_idx_file_t idx_file,
current = (const void *) previous + previous_index->size;
}
if ((const char *) current + sizeof (struct rec_idx_file_index_s)
- > idx_file->buffer)
+ > idx_file->buffer + idx_file->size)
{
return NULL;
}
if ((const char *) current + sizeof (struct rec_idx_file_index_s)
- + current->size > idx_file->buffer)
+ + current->size > idx_file->buffer + idx_file->size)
{
return NULL;
}
--
1.7.11.4
- [bug-recutils] [PATCH 02/13] src,torture: imple ment initial index tree support without nodes., (continued)
- [bug-recutils] [PATCH 02/13] src,torture: imple ment initial index tree support without nodes., Michał Masłowski, 2012/08/20
- [bug-recutils] [PATCH 06/13] utils,doc: make re cfix --build-index add index trees., Michał Masłowski, 2012/08/20
- [bug-recutils] [PATCH 05/13] src: fix index file builder., Michał Masłowski, 2012/08/20
- [bug-recutils] [PATCH 04/13] src,torture: imple ment index builder., Michał Masłowski, 2012/08/20
- [bug-recutils] [PATCH 12/13] src: implement a tri vial query planner., Michał Masłowski, 2012/08/20
- [bug-recutils] [PATCH 09/13] src,torture: suppo rt duplicating index tree objects., Michał Masłowski, 2012/08/20
- [bug-recutils] [PATCH 10/13] src: keep indexes in rsets., Michał Masłowski, 2012/08/20
- [bug-recutils] [PATCH 11/13] src: support index t rees that point to a leaf too left of the key searched f or., Michał Masłowski, 2012/08/20
- [bug-recutils] [PATCH 08/13] utils: add recfix -- add-index command., Michał Masłowski, 2012/08/20
- [bug-recutils] [PATCH 13/13] torture: use index t rees for performance tests., Michał Masłowski, 2012/08/20
- [bug-recutils] [PATCH 07/13] src: fix index range checks.,
Michał Masłowski <=
- [bug-recutils] [PATCH 03/13] src,torture: imple ment index tree scans., Michał Masłowski, 2012/08/20