From ed5f069ae747a22359e3c2e3be8a17d3bceb71a5 Mon Sep 17 00:00:00 2001 From: Daniel Carl Date: Tue, 10 Mar 2015 21:41:11 +0100 Subject: [PATCH] Fix segfault on bookmark completion (#189). If the bookmark file contained lines without any tab char, the completion caused a segfault. --- src/bookmark.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bookmark.c b/src/bookmark.c index 218daec..8c8ea2d 100644 --- a/src/bookmark.c +++ b/src/bookmark.c @@ -317,10 +317,10 @@ static Bookmark *line_to_bookmark(const char *uri, const char *data) char *p; Bookmark *bm; - /* data part may consist of title or titletags*/ + /* data part may consist of title or titletags */ bm = g_slice_new(Bookmark); bm->uri = g_strdup(uri); - if ((p = strchr(data, '\t'))) { + if (data && (p = strchr(data, '\t'))) { *p = '\0'; bm->title = g_strdup(data); bm->tags = g_strdup(p + 1); -- 2.20.1