From 5ac5408bb0775b7126242ec614b48b14cbdf3ab9 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Thu, 6 Dec 2012 10:30:36 -0800 Subject: Fix SIGSEGV when joining dives without dive computer information Handle the case where we have no divecomputer information. Reported-by: Sergey Starosek Signed-off-by: Linus Torvalds Signed-off-by: Dirk Hohndel --- dive.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dive.c b/dive.c index f527fae37..9e44345cf 100644 --- a/dive.c +++ b/dive.c @@ -1292,7 +1292,7 @@ static void interleave_dive_computers(struct divecomputer *res, do { struct divecomputer *match; - res->model = strdup(a->model); + res->model = a->model ? strdup(a->model) : NULL; res->deviceid = a->deviceid; res->diveid = a->diveid; res->next = NULL; -- cgit v1.2.3-70-g09d2