diff options
Diffstat (limited to 'parse-xml.c')
-rw-r--r-- | parse-xml.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/parse-xml.c b/parse-xml.c index 739342951..962980059 100644 --- a/parse-xml.c +++ b/parse-xml.c @@ -2541,6 +2541,10 @@ int parse_dlf_buffer(unsigned char *buffer, size_t size) target_table = &dive_table; + // Check for the correct file magic + if (ptr[0] != 'D' || ptr[1] != 'i' || ptr[2] != 'v' || ptr[3] != 'E') + return -1; + dive_start(); divecomputer_start(); |