mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 23:23:23 +00:00
Core: Do not crash on save dives with no dive site (git storage)
And fix a crash very similar to the previous commit. When trying to save (to git) with an empty dive site, ssrf crashes. Again, add a simple guard to prevent this. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
This commit is contained in:
parent
68d7e7c4e3
commit
26f6d95305
1 changed files with 2 additions and 1 deletions
|
@ -431,7 +431,8 @@ static void create_dive_buffer(struct dive *dive, struct membuffer *b)
|
|||
SAVE("visibility", visibility);
|
||||
cond_put_format(dive->tripflag == NO_TRIP, b, "notrip\n");
|
||||
save_tags(b, dive->tag_list);
|
||||
cond_put_format(!!dive->dive_site, b, "divesiteid %08x\n", dive->dive_site->uuid);
|
||||
if (dive->dive_site)
|
||||
put_format(b, "divesiteid %08x\n", dive->dive_site->uuid);
|
||||
if (verbose && dive->dive_site)
|
||||
fprintf(stderr, "removed reference to non-existant dive site with uuid %08x\n", dive->dive_site->uuid);
|
||||
save_overview(b, dive);
|
||||
|
|
Loading…
Add table
Reference in a new issue