mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 22:23:24 +00:00
Don't crash when creating a dive site ID for a nameless site
This can happen when parsing the GPS data from our web service. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
fe9958380e
commit
cbf29653d7
1 changed files with 2 additions and 0 deletions
|
@ -177,6 +177,8 @@ void delete_dive_site(uint32_t id)
|
||||||
|
|
||||||
uint32_t create_divesite_uuid(const char *name, timestamp_t divetime)
|
uint32_t create_divesite_uuid(const char *name, timestamp_t divetime)
|
||||||
{
|
{
|
||||||
|
if (name == NULL)
|
||||||
|
name ="";
|
||||||
unsigned char hash[20];
|
unsigned char hash[20];
|
||||||
SHA_CTX ctx;
|
SHA_CTX ctx;
|
||||||
SHA1_Init(&ctx);
|
SHA1_Init(&ctx);
|
||||||
|
|
Loading…
Add table
Reference in a new issue