aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-03-22 09:51:43 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-03-22 09:51:43 +0100
commitc88181a7dfb91b59a9959066f942c134c2162353 (patch)
tree6c4440da961167dac53c85c4cd92104dfa72e8ae /openbsc
parent6e79b54d7b7846c7b4de28eabbd08f6a181395af (diff)
ipa-firmware: Look at the table offset
* The two dummy bytes appear to be an offset, check that they are zero and refuse to work when they are not.
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/src/ipaccess/ipaccess-firmware.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/openbsc/src/ipaccess/ipaccess-firmware.c b/openbsc/src/ipaccess/ipaccess-firmware.c
index e0695a629..4975b8865 100644
--- a/openbsc/src/ipaccess/ipaccess-firmware.c
+++ b/openbsc/src/ipaccess/ipaccess-firmware.c
@@ -74,6 +74,13 @@ int ipaccess_analyze_file(int fd, const unsigned int st_size, const unsigned int
INIT_LLIST_HEAD(&header->header_list);
llist_add(&header->entry, list);
+ if (ntohs(firmware_header->table_offset) != 0) {
+ fprintf(stderr, "The table offset is not zero. That is not supported: 0x%x at 0x%x\n",
+ ntohs(firmware_header->table_offset), base_offset);
+ return -1;
+ }
+
+
if (ntohs(firmware_header->part_length) % PART_LENGTH != 0) {
fprintf(stderr, "The part length seems to be wrong.\n");
return -1;