diff options
author | Roman Yeryomin <roman@advem.lv> | 2014-03-12 22:16:14 +0200 |
---|---|---|
committer | Roman Yeryomin <roman@advem.lv> | 2014-03-12 22:16:14 +0200 |
commit | e7483918e2eb27e12243f63884aca5e202a7bbbc (patch) | |
tree | 7f5b7fc2e21c2353bdbff85b1b43b011dc8997ff | |
parent | f6e4b6dc27888de17437155a9d4b088b63701c9b (diff) |
Signed-off-by: Roman Yeryomin <roman@advem.lv>
-rw-r--r-- | rtkmib.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -5,7 +5,7 @@ #include "mibtbl.h" #define NAME "rtkmib" -#define VERSION "0.0.3" +#define VERSION "0.0.4" uint8_t verbose = 0; @@ -175,9 +175,12 @@ static int mib_read( char *mtd, unsigned int offset, sig = header_compr.sig; len = swap32(header_compr.len); compression = swap16(header_compr.factor); - } else { + } else if ( !memcmp( MIB_HEADER_TAG, header.sig, MIB_TAG_LEN ) ) { sig = header.sig; len = swap16(header.len); + } else { + printv("Invalid MIB header!\n"); + return MIB_ERR_GENERIC; } printv( "Header info:\n" ); |