From 2dc1a42b297eb49850767e71a644e5efc349b0c9 Mon Sep 17 00:00:00 2001 From: Miika Turkia Date: Sun, 1 Feb 2015 13:45:07 +0200 Subject: Fix crash if one selects incorrectly Seabear CSV Fixes #814 Signed-off-by: Miika Turkia Signed-off-by: Dirk Hohndel --- file.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'file.c') diff --git a/file.c b/file.c index eacd8756a..e03edaf82 100644 --- a/file.c +++ b/file.c @@ -932,6 +932,13 @@ int parse_seabear_csv_file(const char *filename, int timef, int depthf, int temp NL = "\r\n"; } + /* + * If file does not contain empty lines, it is not a valid + * Seabear CSV file. + */ + if (!ptr) + return -1; + if (!ptr_old) { while ((ptr = strstr(ptr, "\n\n")) != NULL) { ptr_old = ptr; -- cgit v1.2.3-70-g09d2