From: Uwe Hermann Date: Fri, 2 Sep 2016 18:05:52 +0000 (+0200) Subject: csv: Fix a segfault when using non-hardware input. X-Git-Tag: libsigrok-0.5.0~222 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=cf1d5f1749fc6b6511c72563233375ac61cfb548;p=libsigrok.git csv: Fix a segfault when using non-hardware input. --- diff --git a/src/output/csv.c b/src/output/csv.c index 9c6d8d5f..6900200d 100644 --- a/src/output/csv.c +++ b/src/output/csv.c @@ -236,7 +236,7 @@ static GString *gen_header(const struct sr_output *o, sr_info("Set sample period to %" PRIu64 " %s", ctx->period, ctx->xlabel); } - ctx->title = o->sdi->driver->longname; + ctx->title = (o->sdi && o->sdi->driver) ? o->sdi->driver->longname : "unknown"; /* Some metadata */ if (ctx->header && !ctx->did_header) {