git://project.juiblex.co.uk
/
razor.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
b98997a
)
Don't touch v2+ rzdb files
0.3
author
J. Ali Harlow
<ali@juiblex.co.uk>
Thu, 1 Oct 2009 18:35:56 +0000 (19:35 +0100)
committer
J. Ali Harlow
<ali@juiblex.co.uk>
Thu, 1 Oct 2009 19:02:23 +0000 (20:02 +0100)
librazor/razor.c
patch
|
blob
|
history
diff --git
a/librazor/razor.c
b/librazor/razor.c
index
b3f9c6a
..
5a9d848
100644
(file)
--- a/
librazor/razor.c
+++ b/
librazor/razor.c
@@
-143,6
+143,14
@@
razor_set_bind_sections(struct razor_set *set, const char *filename)
return -1;
}
+ if (file->size < sizeof *file->header ||
+ file->header->magic != RAZOR_MAGIC ||
+ file->header->version != RAZOR_VERSION) {
+ razor_file_free_contents(file->header, file->size);
+ free(file);
+ return -1;
+ }
+
if (set->mapped_files == NULL) {
for (i = 0; i < ARRAY_SIZE(razor_sections); i++) {
array = (void *) set + razor_sections[i].offset;