From 5ba6db80cc67c2e74f572acf1e455551c024b1f8 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Fri, 5 Mar 2021 22:00:31 +0100 Subject: parser: initialize picture variable When parsing "event 123" (?) a picture is added, without initializing the picture structure. Thus, a picture with a random gps location is added. Use the "empty_picture" initializer to avoid that. Fixes a Coverity warning. Signed-off-by: Berthold Stoeger --- core/parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core') diff --git a/core/parse.c b/core/parse.c index d2be71e21..459108a26 100644 --- a/core/parse.c +++ b/core/parse.c @@ -114,7 +114,7 @@ void event_end(struct parser_state *state) { struct divecomputer *dc = get_dc(state); if (state->cur_event.type == 123) { - struct picture pic; + struct picture pic = empty_picture; pic.filename = strdup(state->cur_event.name); /* theoretically this could fail - but we didn't support multi year offsets */ pic.offset.seconds = state->cur_event.time.seconds; -- cgit v1.2.3-70-g09d2