summaryrefslogtreecommitdiffstats
path: root/divesite.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-09-27 13:16:40 -0400
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-09-27 13:16:40 -0400
commitcbf29653d7e9d92660295c7c5ffbbdbaba1886fb (patch)
treeaa57134c089b106b6ab9e04bdbb00ffaf1d34ae0 /divesite.c
parentfe9958380edba2025e1086dbf600064e420e3232 (diff)
downloadsubsurface-cbf29653d7e9d92660295c7c5ffbbdbaba1886fb.tar.gz
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>
Diffstat (limited to 'divesite.c')
-rw-r--r--divesite.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/divesite.c b/divesite.c
index f668889f3..1e179820f 100644
--- a/divesite.c
+++ b/divesite.c
@@ -177,6 +177,8 @@ void delete_dive_site(uint32_t id)
uint32_t create_divesite_uuid(const char *name, timestamp_t divetime)
{
+ if (name == NULL)
+ name ="";
unsigned char hash[20];
SHA_CTX ctx;
SHA1_Init(&ctx);