]> sigrok.org Git - libsigrok.git/commitdiff
dev_acquisition_start(): Ensure that sdi is always != NULL.
authorUwe Hermann <redacted>
Fri, 15 Apr 2016 14:26:43 +0000 (16:26 +0200)
committerUwe Hermann <redacted>
Fri, 29 Apr 2016 17:26:17 +0000 (19:26 +0200)
src/session.c

index 23dc0c3a025b99d53245c426e40b3197ac37e168..41ebcf22353633c2e79f0f9f1117457c85950259 100644 (file)
@@ -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.",