From f7f13ad3a7a60a9f84653126744f8cc61d17e952 Mon Sep 17 00:00:00 2001 From: Gwenhael Goavec-Merou Date: Sun, 12 Jan 2020 16:29:29 +0100 Subject: [PATCH] gowin: set file descriptor to NULL to avoid segfault when no file a provided --- gowin.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/gowin.cpp b/gowin.cpp index 0165317..a6ea406 100644 --- a/gowin.cpp +++ b/gowin.cpp @@ -66,6 +66,7 @@ using namespace std; Gowin::Gowin(FtdiJtag *jtag, const string filename, bool flash_wr, bool sram_wr, bool verbose): Device(jtag, filename, verbose) { + _fs = NULL; if (_filename != "") { if (_file_extension == "fs") { if (flash_wr && sram_wr)