Improve data parsing

- add length defines for variable data header and fixed data
- add size check for fixed data
- avoid problems with memory alignment / padding in mbus structures
(improve portability)
- abort parsing if there are too many DIFE or VIFEs
- check for premature end of variable data
- check size of variable length VIF
This commit is contained in:
Stefan Wahren
2013-06-22 11:50:36 +02:00
parent 3381d1b41d
commit dd56a08811
2 changed files with 100 additions and 13 deletions

View File

@ -192,6 +192,8 @@ typedef struct _mbus_data_variable_header {
} mbus_data_variable_header;
#define MBUS_DATA_VARIABLE_HEADER_LENGTH 12
//
// VARIABLE LENGTH DATA FORMAT
//
@ -241,6 +243,8 @@ typedef struct _mbus_data_fixed {
} mbus_data_fixed;
#define MBUS_DATA_FIXED_LENGTH 16
//
// ABSTRACT DATA FORMAT (error, fixed or variable length)
//