Hi,

The driver jp-3478a uses the dfi parameter before testing the key on the config+list function. The function sr_dev_options call driver->config_list and explicitly says that sdi can be NULL for just checking driver options. The patch attached moves the offending line to inside the option of the switch that uses that variable. That solves the pulseview seg fault on startup.
The diff is against master on the git://sigrok.org/libsigrok

Thanks,.


Alexandre Peixoto Ferreira
---------------------------
If the English language made any sense, lackadaisical would have something
to do with a shortage of flowers.
                -- Doug Larson

        [Not to mention, butterfly would be flutterby. Ed.]

diff --git a/src/hardware/hp-3478a/api.c b/src/hardware/hp-3478a/api.c
index cc5d4cb7..b0d37a1f 100644
--- a/src/hardware/hp-3478a/api.c
+++ b/src/hardware/hp-3478a/api.c
@@ -278,8 +278,6 @@ static int config_list(uint32_t key, GVariant **data,
 	GVariant *gvar, *arr[2];
 	GVariantBuilder gvb;
 
-	devc = sdi->priv;
-
 	switch (key) {
 	case SR_CONF_SCAN_OPTIONS:
 	case SR_CONF_DEVICE_OPTIONS:
@@ -299,6 +297,8 @@ static int config_list(uint32_t key, GVariant **data,
 		*data = g_variant_builder_end(&gvb);
 		break;
 	case SR_CONF_RANGE:
+		devc = sdi->priv;
+
 		ret = hp_3478a_get_status_bytes(sdi);
 		if (ret != SR_OK)
 			return ret;
_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to