The asix-sigma config_list() routine unconditionally dereferenced the
'sdi' pointer, which could be NULL. Properly check before dereferencing.
This issue was introduced in commit
eabf9ca630f4. How to reproduce:
$ sigrok-cli -d asix-sigma --show
Reported-By: Paul Kasemir <redacted>
const char **names;
size_t count;
- devc = sdi->priv;
+ devc = sdi ? sdi->priv : NULL;
switch (key) {
case SR_CONF_SCAN_OPTIONS:
case SR_CONF_DEVICE_OPTIONS:
*data = sigma_get_samplerates_list();
break;
case SR_CONF_EXTERNAL_CLOCK_SOURCE:
+ if (!devc)
+ return SR_ERR_ARG;
names = (const char **)devc->channel_names;
count = g_strv_length(devc->channel_names);
*data = g_variant_new_strv(names, count);