mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Verify the file header magic before importing DLF
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
a65816db7d
commit
ed91a6373c
1 changed files with 4 additions and 0 deletions
|
@ -2541,6 +2541,10 @@ int parse_dlf_buffer(unsigned char *buffer, size_t size)
|
||||||
|
|
||||||
target_table = &dive_table;
|
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();
|
dive_start();
|
||||||
divecomputer_start();
|
divecomputer_start();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue