From: Uwe Hermann Date: Fri, 15 Apr 2016 14:26:43 +0000 (+0200) Subject: dev_acquisition_start(): Ensure that sdi is always != NULL. X-Git-Tag: libsigrok-0.5.0~478 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=df3ea149cc65ae52f19fa4b50c4af7a217a590fa;p=libsigrok.git dev_acquisition_start(): Ensure that sdi is always != NULL. --- diff --git a/src/session.c b/src/session.c index 23dc0c3a..41ebcf22 100644 --- a/src/session.c +++ b/src/session.c @@ -811,7 +811,11 @@ SR_API int sr_session_start(struct sr_session *session) /* Have all devices start acquisition. */ for (l = session->devs; l; l = l->next) { - sdi = l->data; + if (!(sdi = l->data)) { + sr_err("Device sdi was NULL, can't start session."); + ret = SR_ERR; + break; + } ret = sdi->driver->dev_acquisition_start(sdi); if (ret != SR_OK) { sr_err("Could not start %s device %s acquisition.",