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:
@ -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)
|
||||
//
|
||||
|
Reference in New Issue
Block a user